I noted that comma cannot be part of the symbol; it appears identifier
x,y
is understood like it is the sequence of three symbols
x , y
Is it intentional?
Why comma is special?
-
- Posts: 388
- Joined: Thu May 08, 2008 1:24 am
- Location: Croatia
- Contact:
Yes, it is intentional. The comma is a newlisp idiom for establishing local variables in a function:
Code: Select all
(define (foo param , a b c)
;; here, a, b, and c are nil
(println "Hello world"))
From the manual
Some of the example programs contain functions that use a comma to separate the parameters into two groups. This is not a special syntax of newLISP, but rather a visual trick. The comma is a symbol just like any other symbol.
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2
"Getting Started with Erlang" version 5.6.2