I'm using newLISP v9.0 on win.
I read about comma in parameters lists but they don't seem to work, what I'm doing wrong?
(define (test2 , b c)
,)
(test2 1 2 3)
returns 1! the comma is bounded!. Why is that?
I don't think the comma - or the period - is special in newLISP, it's just another character.
(define (, x y z)
(+ x y z))
(define (. x y z)
(* x y z))
(define (a . ,)
(+ . , ))
(, 1 2 3)
;-> 6
(. 4 5 6)
;-> 120
(a 2 3)
;-> 5
Most of the familiar punctuation characters (+ _ & ^ % $ @) are already reserved.
--
(define (‽) ; a unicode joke
"you what‽")
(‽)
--> you what‽
Yes, the comma is just a symbol like any other character. This is all documented in chapter 19 of the manual:
file:///usr/share/newlisp/doc/newlisp_manual.html#commas
The differene between the comma and the period is that the period can be embedded in a symbol name, but the comma breaks the string, similar to the colon:
> (set 'a 1 ', 2 'b 3)
3
> a,b
1
2
3
>
Lutz