Open TheGreatCatAdorer opened 2 years ago
Additionally, any further entries into the REPL error with The function SHEN::|declare-reduce-binary| is undefined.
Reads as
[LET* [[w [gensym [QUOTE W]]]
[x [gensym [QUOTE X]]]
[y [gensym [QUOTE Y]]]
[zs [gensym [QUOTE Zs]]]]
[defun [QUOTE declare-reduce-binary] [V20]
[COND [[AND [CONSP [QUOTE V20]]
[AND [EQ [CAR [QUOTE V20]] [QUOTE declare]]
[AND [CONSP [CDR [QUOTE V20]]]
[AND [CONSP [CAR [CDR [QUOTE V20]]]]
[AND [EQ [CAR [CAR [CDR [QUOTE V20]]]] [QUOTE reduce-binary]]
[AND [CONSP [CDR [CAR [CDR [QUOTE V20]]]]]
[NULL [CDR [CDR [CAR [CDR [QUOTE V20]]]]]]]]]]]]
[LET [[macro-name [gensym [CAR [CDR [CAR [CDR [QUOTE V20]]]]]]]]
[LIST [LIST [QUOTE lambda] x [LIST [QUOTE lambda] y y]]
[LIST [QUOTE defmacro] macro-name
[CONS [QUOTE query] [CAR [CDR [QUOTE V20]]]]
[QUOTE ->]
macro-name
[CONS [CAR [CDR [CAR [CDR [QUOTE V20]]]]]
[CONS w [CONS x [CONS y zs]]]]
[QUOTE ->]
[LIST [CAR [CDR [CAR [CDR [QUOTE V20]]]]]
w
[CONS [CAR [CDR [CAR [CDR [QUOTE V20]]]]]
[CONS x [CONS y zs]]]]]
[CONS [QUOTE declare]
[CDR [CDR [QUOTE V20]]]]]]]
[T [QUOTE V20]]]]]
Hi @TheGreatCatAdorer. The defmacro
declaration needs to be at the top level, you cannot put it inside a let
(same applies to define
). Another issue is that the expanded code cannot contain multiple forms, if you need that you have to wrap them in [package null [] ....]
so that they become a single form.
Btw, for let bindings you should use upper-case names, otherwise the code may not be portable.
error:
The function SHEN::V154 is undefined.
version: