Page 1 of 1

parse and colons?

Posted: Wed Nov 21, 2007 4:16 pm
by cormullion
What is parse supposed to do for colons?

Code: Select all

> (parse {(define (fred jim) (println fred jim))})
("(" "define" "(" "fred" "jim" ")" "(" "println" "fred" "jim" ")"  ")")
> (parse {(define (fred:jim) (println fred jim))})
("(" "define" "(" "fred" "jim" ")" "(" "println" "fred" "jim" ")"  ")")
It appears to ignore them, even though it's supposed to use the newlisp internal parser when there are no options...
I know that the colon is enhanced for the latest release...

Posted: Wed Nov 21, 2007 6:27 pm
by Lutz
The colon if it follows directly after a symbol is not recognized as an extra token. You could preprocess the string replacing all ":" with a space before it.

Lutz

Posted: Wed Nov 21, 2007 7:03 pm
by cormullion
gotcha. Thanks!