diff options
author | Eduardo Julian | 2017-02-22 18:01:05 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-02-22 18:01:05 -0400 |
commit | 38a81332a1cefb51ff89ee96a16bb4a65cee21bc (patch) | |
tree | 77db433c79db101a455e406415e1f801417de98a /stdlib/source/lux.lux | |
parent | 03a41265b2619257be45fddac691cb5bc18765a7 (diff) |
- Implemented a variety of new procedures for text, chars, math and arrays.
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r-- | stdlib/source/lux.lux | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index c6018398b..01064b829 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -2100,6 +2100,7 @@ (-> Char Text) (let' [as-text (_lux_case x #"\t" "\\t" + #"\v" "\\v" #"\b" "\\b" #"\n" "\\n" #"\r" "\\r" @@ -3222,13 +3223,14 @@ (#Some y) (#Some y)))) -(def: (last-index-of part text) - (-> Text Text (Maybe Nat)) - (_lux_proc ["text" "last-index"] [text part])) +(do-template [<name> <proc> <start>] + [(def: (<name> part text) + (-> Text Text (Maybe Nat)) + (_lux_proc ["text" <proc>] [text part <start>]))] -(def: (index-of part text) - (-> Text Text (Maybe Nat)) - (_lux_proc ["text" "index"] [text part])) + [index-of "index" +0] + [last-index-of "last-index" (_lux_proc ["text" "size"] [text])] + ) (def: (clip1 from text) (-> Nat Text (Maybe Text)) @@ -3954,7 +3956,8 @@ [_ (#SymbolS "" m-name)] (do Monad<Lux> [m-name (clean-module m-name)] - (wrap (list [m-name #None {#refer-defs #All #refer-open (list)}]))) + (wrap (list [m-name #None {#refer-defs #All + #refer-open (list)}]))) (^ [_ (#FormS (list& [_ (#SymbolS "" m-name)] extra))]) (do Monad<Lux> @@ -4863,6 +4866,7 @@ (-> Text Text) (let [escaped (|> original (replace "\t" "\\t") + (replace "\v" "\\v") (replace "\b" "\\b") (replace "\n" "\\n") (replace "\r" "\\r") |