Page 1 of 1

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

Posted: Fri Mar 16, 2012 6:19 am
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?

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

Posted: Fri Mar 16, 2012 6:41 am
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