aboutsummaryrefslogtreecommitdiff
path: root/lux-r
diff options
context:
space:
mode:
authorEduardo Julian2021-08-12 03:12:42 -0400
committerEduardo Julian2021-08-12 03:12:42 -0400
commit17629d66062b88b040a2397032f6c08361a5f3a7 (patch)
treebdc6110750b895667b9e45da5e46bec9609f9a7c /lux-r
parenta62ce3f9c2b605e0033f4772b0f64c4525de4d86 (diff)
Improved binding syntax for "syntax:".
Diffstat (limited to '')
-rw-r--r--lux-r/source/luxc/lang/synthesis/variable.lux8
-rw-r--r--lux-r/source/program.lux6
-rw-r--r--lux-ruby/source/program.lux2
3 files changed, 9 insertions, 7 deletions
diff --git a/lux-r/source/luxc/lang/synthesis/variable.lux b/lux-r/source/luxc/lang/synthesis/variable.lux
index 932cb3dcb..f747a82df 100644
--- a/lux-r/source/luxc/lang/synthesis/variable.lux
+++ b/lux-r/source/luxc/lang/synthesis/variable.lux
@@ -46,11 +46,11 @@
(def: (unused-vars current-arity bound exprS)
(-> ls.Arity (List Variable) ls.Synthesis (List Variable))
(let [tracker (loop [exprS exprS
- tracker (list/fold s.add init-tracker bound)]
+ tracker (list/fold s.has init-tracker bound)]
(case exprS
(#ls.Variable var)
(if (non-arg? current-arity var)
- (s.remove var tracker)
+ (s.lacks var tracker)
tracker)
(#ls.Variant tag last? memberS)
@@ -76,13 +76,13 @@
(recur bodyS (list/fold recur tracker initsS))
(#ls.Case inputS outputPS)
- (let [tracker' (list/fold s.add
+ (let [tracker' (list/fold s.has
(recur inputS tracker)
(bound-vars outputPS))]
(list/fold recur tracker' (path-bodies outputPS)))
(#ls.Function arity env bodyS)
- (list/fold s.remove tracker env)
+ (list/fold s.lacks tracker env)
_
tracker
diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux
index 245883eb4..de859ba50 100644
--- a/lux-r/source/program.lux
+++ b/lux-r/source/program.lux
@@ -12,7 +12,9 @@
["." exception (#+ exception:)]
["." io (#+ IO io)]
[concurrency
- ["." promise (#+ Promise)]]]
+ ["." promise (#+ Promise)]]
+ [parser
+ ["<.>" code]]]
[data
["." text ("#\." hash)
["%" format (#+ format)]
@@ -176,7 +178,7 @@
... (|>> (case> #0 (org/armedbear/lisp/Nil::NIL)
... #1 (org/armedbear/lisp/Symbol::T))))
-(syntax: (%%code term)
+(syntax: (%%code [term <code>.any])
(wrap (list (code.text (%.code term)))))
(def: (host_value value)
diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux
index 2a07dc220..5c16bdd36 100644
--- a/lux-ruby/source/program.lux
+++ b/lux-ruby/source/program.lux
@@ -136,7 +136,7 @@
[StructureValue]
)
-(syntax: (method_inputs {input_classes (<code>.tuple (<>.some <code>.any))})
+(syntax: (method_inputs [input_classes (<code>.tuple (<>.some <code>.any))])
(monad.map meta.monad
(function (_ class)
(do meta.monad