Closed sjl closed 11 years ago
"LispyScript is not a dialect of Lisp. There is no list processing in LispyScript." means that List Processing is not available in LispyScript, and you may not be able to do some things the Lisp way. However you can do similar things in other ways. Problems similar to yours will be addressed in the future versions.
You don't necessarily need lists to be homoiconic. You could in principle use native Javascript arrays. Or you could use objects like Julia does. If you're not going to do that that's fine, but just saying it doesn't process lists doesn't really make it clear that homoiconicity (and all the power that you get with it) isn't on the agenda.
In LispyScript code and data is distinguished by context. The third argument in a macro expression is treated as data. Thats the code the macro will expand to after dereferencing is done.
The latest source now contains support for recursive macros and homoiconic expressions, which work specifically inside macro definitions. I haven't documented these yet, but that is how the "cond" macro and "->" (method chaining macro) are implemented. Have a look at the macros.ls for now.
Right now it seems like
macro
is just kind of a templating engine instead of a full, Lispy macro implementation. For example, what if I wanted a macro that would let me insert some logging between each line of a function? Ideally I'd do something like this (in pseudocode):Which would macroexpand to:
Is this simply not going to happen, and that's what "LispyScript is not a dialect of Lisp. There is no list processing in LispyScript." means? I haven't looked at the implementation, so I don't know how homoiconic LispyScript is...