aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/function
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/control/function')
-rw-r--r--stdlib/source/library/lux/control/function/contract.lux18
-rw-r--r--stdlib/source/library/lux/control/function/memo.lux4
-rw-r--r--stdlib/source/library/lux/control/function/mixin.lux2
-rw-r--r--stdlib/source/library/lux/control/function/mutual.lux82
4 files changed, 53 insertions, 53 deletions
diff --git a/stdlib/source/library/lux/control/function/contract.lux b/stdlib/source/library/lux/control/function/contract.lux
index 414445ac1..00c1bb59c 100644
--- a/stdlib/source/library/lux/control/function/contract.lux
+++ b/stdlib/source/library/lux/control/function/contract.lux
@@ -34,10 +34,10 @@
"Otherwise, an error is raised."
(pre (i.= +4 (i.+ +2 +2))
(foo +123 +456 +789)))}
- (wrap (list (` (exec
- ((~! ..assert!) (~ (code.text (exception.construct ..pre_condition_failed test)))
- (~ test))
- (~ expr))))))
+ (in (list (` (exec
+ ((~! ..assert!) (~ (code.text (exception.construct ..pre_condition_failed test)))
+ (~ test))
+ (~ expr))))))
(syntax: #export (post test expr)
{#.doc (doc "Post-conditions."
@@ -47,8 +47,8 @@
(post i.even?
(i.+ +2 +2)))}
(with_gensyms [g!output]
- (wrap (list (` (let [(~ g!output) (~ expr)]
- (exec
- ((~! ..assert!) (~ (code.text (exception.construct ..post_condition_failed test)))
- ((~ test) (~ g!output)))
- (~ g!output))))))))
+ (in (list (` (let [(~ g!output) (~ expr)]
+ (exec
+ ((~! ..assert!) (~ (code.text (exception.construct ..post_condition_failed test)))
+ ((~ test) (~ g!output)))
+ (~ g!output))))))))
diff --git a/stdlib/source/library/lux/control/function/memo.lux b/stdlib/source/library/lux/control/function/memo.lux
index e2b734cae..da293b1f6 100644
--- a/stdlib/source/library/lux/control/function/memo.lux
+++ b/stdlib/source/library/lux/control/function/memo.lux
@@ -25,13 +25,13 @@
[memory state.get]
(case (dictionary.get input memory)
(#.Some output)
- (wrap output)
+ (in output)
#.None
(do !
[output (delegate input)
_ (state.update (dictionary.put input output))]
- (wrap output)))))))
+ (in output)))))))
(type: #export (Memo i o)
(Recursive i (State (Dictionary i o) o)))
diff --git a/stdlib/source/library/lux/control/function/mixin.lux b/stdlib/source/library/lux/control/function/mixin.lux
index 8248b2055..796c04057 100644
--- a/stdlib/source/library/lux/control/function/mixin.lux
+++ b/stdlib/source/library/lux/control/function/mixin.lux
@@ -60,7 +60,7 @@
(do monad
[output (delegate input)
_ (action input output)]
- (wrap output))))
+ (in output))))
(type: #export (Recursive i o)
{#.doc (doc "An indirectly recursive function.")}
diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux
index 97d2c3ac1..73407a7f1 100644
--- a/stdlib/source/library/lux/control/function/mutual.lux
+++ b/stdlib/source/library/lux/control/function/mutual.lux
@@ -51,7 +51,7 @@
(<| (:as Macro)
(: Macro')
(function (_ parameters)
- (\ meta.monad wrap (list (` (((~ g!self) (~ g!context)) (~+ parameters))))))))
+ (\ meta.monad in (list (` (((~ g!self) (~ g!context)) (~+ parameters))))))))
(syntax: #export (let {functions (<code>.tuple (<>.some ..mutual))}
body)
@@ -71,14 +71,14 @@
(odd? 5))))}
(case functions
#.Nil
- (wrap (list body))
+ (in (list body))
(#.Cons mutual #.Nil)
(.let [g!name (|> mutual (get@ [#declaration #declaration.name]) code.local_identifier)]
- (wrap (list (` (.let [(~ g!name) (: (~ (get@ #type mutual))
- (function (~ (declaration.format (get@ #declaration mutual)))
- (~ (get@ #body mutual))))]
- (~ body))))))
+ (in (list (` (.let [(~ g!name) (: (~ (get@ #type mutual))
+ (function (~ (declaration.format (get@ #declaration mutual)))
+ (~ (get@ #body mutual))))]
+ (~ body))))))
_
(macro.with_gensyms [g!context g!output]
@@ -99,16 +99,16 @@
(..macro g!context g!name)])
(list.zipped/2 hidden_names
functions)))]
- (wrap (list (` (.let [(~ g!context) (: (Rec (~ g!context)
- [(~+ context_types)])
- [(~+ definitions)])
- [(~+ user_names)] (.let [[(~+ user_names)] (~ g!context)]
- [(~+ (list\map (function (_ g!name)
- (` ((~ g!name) (~ g!context))))
- user_names))])
- (~ g!output) (~ body)]
- (exec (~ g!pop)
- (~ g!output))))))))))
+ (in (list (` (.let [(~ g!context) (: (Rec (~ g!context)
+ [(~+ context_types)])
+ [(~+ definitions)])
+ [(~+ user_names)] (.let [[(~+ user_names)] (~ g!context)]
+ [(~+ (list\map (function (_ g!name)
+ (` ((~ g!name) (~ g!context))))
+ user_names))])
+ (~ g!output) (~ body)]
+ (exec (~ g!pop)
+ (~ g!output))))))))))
(type: Definition
{#exported? Bit
@@ -135,16 +135,16 @@
_ (even? (dec number)))]))}
(case functions
#.Nil
- (wrap (list))
+ (in (list))
(#.Cons definition #.Nil)
(.let [(^slots [#exported? #mutual]) definition
(^slots [#declaration #type #body]) mutual]
- (wrap (list (` (.def:
- (~+ (export.format exported?))
- (~ (declaration.format declaration))
- (~ type)
- (~ body))))))
+ (in (list (` (.def:
+ (~+ (export.format exported?))
+ (~ (declaration.format declaration))
+ (~ type)
+ (~ body))))))
_
(macro.with_gensyms [g!context g!output]
@@ -165,22 +165,22 @@
(..macro g!context g!name)])
(list.zipped/2 hidden_names
functions)))]
- (wrap (list& (` (.def: (~ g!context)
- [(~+ (list\map (get@ [#mutual #type]) functions))]
- (.let [(~ g!context) (: (Rec (~ g!context)
- [(~+ context_types)])
- [(~+ definitions)])
- [(~+ user_names)] (~ g!context)]
- [(~+ (list\map (function (_ g!name)
- (` ((~ g!name) (~ g!context))))
- user_names))])))
- g!pop
- (list\map (function (_ mutual)
- (.let [g!name (|> mutual (get@ [#mutual #declaration #declaration.name]) code.local_identifier)]
- (` (.def:
- (~+ (export.format (get@ #exported? mutual)))
- (~ g!name)
- (~ (get@ [#mutual #type] mutual))
- (.let [[(~+ user_names)] (~ g!context)]
- (~ g!name))))))
- functions)))))))
+ (in (list& (` (.def: (~ g!context)
+ [(~+ (list\map (get@ [#mutual #type]) functions))]
+ (.let [(~ g!context) (: (Rec (~ g!context)
+ [(~+ context_types)])
+ [(~+ definitions)])
+ [(~+ user_names)] (~ g!context)]
+ [(~+ (list\map (function (_ g!name)
+ (` ((~ g!name) (~ g!context))))
+ user_names))])))
+ g!pop
+ (list\map (function (_ mutual)
+ (.let [g!name (|> mutual (get@ [#mutual #declaration #declaration.name]) code.local_identifier)]
+ (` (.def:
+ (~+ (export.format (get@ #exported? mutual)))
+ (~ g!name)
+ (~ (get@ [#mutual #type] mutual))
+ (.let [[(~+ user_names)] (~ g!context)]
+ (~ g!name))))))
+ functions)))))))