(parse x {\n}) vs (parse x "\n")

Q&A's, tips, howto's
Locked
kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

(parse x {\n}) vs (parse x "\n")

Post by kanen »

The title says it all.

I have a file called "foo"

Code: Select all

foo
bar
baz
bif
doodle

Code: Select all

> (length (parse (read-file "foo") "\n"))
6
> (length (parse (read-file "foo") {\n}))
1
What am I missing in this behavior?
. Kanen Flowers http://kanen.me .

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

Re: (parse x {\n}) vs (parse x "\n")

Post by Lutz »

Quoting with the curly brackets suppresses the backslash escape effect for special characters. See str in:

http://www.newlisp.org/downloads/newlis ... l#type_ids

Locked