aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/type/primitive.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/type/primitive.lux')
-rw-r--r--stdlib/source/library/lux/type/primitive.lux46
1 files changed, 24 insertions, 22 deletions
diff --git a/stdlib/source/library/lux/type/primitive.lux b/stdlib/source/library/lux/type/primitive.lux
index 739afa0cd..5825cdf92 100644
--- a/stdlib/source/library/lux/type/primitive.lux
+++ b/stdlib/source/library/lux/type/primitive.lux
@@ -47,16 +47,17 @@
(Stack Frame)
{.#End})
-(template: (!peek <source> <reference> <then>)
- [(loop (again [entries <source>])
- (case entries
- {.#Item [head_name head] tail}
- (if (text#= <reference> head_name)
- <then>
- (again tail))
-
- {.#End}
- (undefined)))])
+(def: !peek
+ (template (_ <source> <reference> <then>)
+ [(loop (again [entries <source>])
+ (case entries
+ {.#Item [head_name head] tail}
+ (if (text#= <reference> head_name)
+ <then>
+ (again tail))
+
+ {.#End}
+ (undefined)))]))
(def: (peek_frames_definition reference source)
(-> Text (List [Text Global]) (Stack Frame))
@@ -105,18 +106,19 @@
(-> Text (Meta Frame))
(..peek! {.#Some name}))
-(template: (!push <source> <reference> <then>)
- [(loop (again [entries <source>])
- (case entries
- {.#Item [head_name head] tail}
- (if (text#= <reference> head_name)
- {.#Item [head_name <then>]
- tail}
- {.#Item [head_name head]
- (again tail)})
+(def: !push
+ (template (_ <source> <reference> <then>)
+ [(loop (again [entries <source>])
+ (case entries
+ {.#Item [head_name head] tail}
+ (if (text#= <reference> head_name)
+ {.#Item [head_name <then>]
+ tail}
+ {.#Item [head_name head]
+ (again tail)})
- {.#End}
- (undefined)))])
+ {.#End}
+ (undefined)))]))
(def: (push_frame_definition reference frame source)
(-> Text Frame (List [Text Global]) (List [Text Global]))
@@ -185,7 +187,7 @@
(<>.either (<>.and (<>.maybe <code>.local) <code>.any)
(<>.and (<>#in {.#None}) <code>.any)))
-(template [<name> <from> <to>]
+(with_template [<name> <from> <to>]
[(def: .public <name>
(syntax (_ [[frame value] ..cast])
(do meta.monad