2018-03-02 17:29:29 +03:00
|
|
|
(system-include "carp_pattern.h")
|
|
|
|
|
|
|
|
(defmodule Pattern
|
|
|
|
(register find (Fn [&Pattern &String] Int))
|
|
|
|
(register match (Fn [&Pattern &String] (Array String)))
|
|
|
|
(register match-str (Fn [&Pattern &String] String))
|
|
|
|
(register global-match (Fn [&Pattern &String] (Array (Array String))))
|
|
|
|
(register substitute (Fn [&Pattern &String &String Int] String))
|
|
|
|
(defn matches? [pat s] (/= (find pat s) -1))
|
2018-03-03 16:59:12 +03:00
|
|
|
|
|
|
|
(register str (Fn [&Pattern] String))
|
|
|
|
(register prn (Fn [&Pattern] String))
|
|
|
|
|
|
|
|
(register init (Fn [&String] Pattern))
|
|
|
|
(register = (Fn [&Pattern &Pattern] Bool))
|
|
|
|
(register delete (Fn [Pattern] ()))
|
|
|
|
(register copy (Fn [&Pattern] Pattern))
|
2018-03-02 17:29:29 +03:00
|
|
|
)
|