rxi / fe

A tiny, embeddable language implemented in ANSI C
MIT License
1.31k stars 82 forks source link

Strange behavior with macro expanding #31

Open ooichu opened 1 year ago

ooichu commented 1 year ago

For example (is nil ((mac () nil))) returns nil, although the macro expands to nil and this should be equivalent to (is nil nil).

The problem is that when the macro is evaluated, the value of the original form is replaced by the result of the macro expansion and create new nil object.

thacuber2a03 commented 1 year ago

that's weird, considering there's only one nil in the entire language, and anything that returns/evaluates to nil evaluates to that nil