Many characters are automatically split from symbols in parameter lists. For example,
(foo bar ,baz :bat)
expands its parameter list to:
(bar , baz : bat)
(5 parameters, rather than three)
This is bad behavior. It happens even in a macro. Perhaps commas could be excepted, as they are convention in newLisp, but probably it's a bug in the code, rather than an intended behavior.
Edit: this occurs in both stable 9.1 and 9.1.7 on osx 10.4.
Section 1 of the newLISP Function Reference portion of the manual disallows the comma as the start of a variable name. Both commas and colons are prohibited from being inside a variable name as they are used to mark the end of a symbol.
The manual seems to imply that the colon is a legal start character though.
this is intended and documented here:
http://newlisp.org/downloads/newlisp_manual.html#commas
Same for the colon ':' . You could use this to define special operators. E.g. I have used this definition for the colon to make a shorter to type hash functionality:
(constant (global ':) context)
(: 'Foo "x" 123)
(: Foo "x") => 123
also puts a lot of smileys in your code ;-)
Lutz
Quote
The manual seems to imply that the colon is a legal start character though
see also here:
http://newlisp.org/downloads/newlisp_manual.html#symbol_names
Lutz
So there is no good way to emulate the common lisp backtick/comma use to create function templates apart from using lengthy expand expressions?
No, but perhaps you can find a way to built templates with letex and expand? Perhaps they come out lengthier but (for my taste ;-) ) better readable and understandable.
Lutz
Quote from: "Jeff"
So there is no good way to emulate the common lisp backtick/comma use to create function templates apart from using lengthy expand expressions?
Hi Jeff!
Yes there is a way to do this. Lutz, Dmi and I discussed this (//http) a little over a year ago. Maybe you can write something better (in particular, faster).
--Rick