parse and colons?

For the Compleat Fan
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

parse and colons?

Post 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...

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post 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

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

gotcha. Thanks!

Locked