-
Notifications
You must be signed in to change notification settings - Fork 4
syntax
TurtleKitty edited this page Jan 29, 2016
·
4 revisions
This operator exports names bound to operators when called via load.
; foo.sxy
(macro m1 (x y z)
(list 'quote (list x y z)))
(syntax
quote-xyz m1
calc-xyz m2)
(macro m2 (x y z)
(list 'proc (list 'v)
(list '* 'v (+ x (* 2 y) (* 4 z)))))
; bar.sxy
(use foo "foo.sxy")
(quote-xyz 1 2 3) -> (quote (1 2 3)) -> (1 2 3)
((calc-xyz 1 2 3) 4) -> ((proc (v) (* v (+ 1 (* 2 2) (* 4 3)))) 4) -> 68