Problem in format

Started by Jeff, June 04, 2007, 09:42:13 AM

Previous topic - Next topic

Jeff

There is a problem string formatting a % character after an actual %format character.  For example:


(format "%% %s %%" "hello world") ; *should* => "% hello world %"

...but, in actuality, does "% hello world %%".
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

Lutz

#1
This will be fixed in 9.1.8 (due this weekend). As a workaround use:


(format "%c %s %c" 37 "hello" 37) => "% hello %"

Lutz

rickyboy

#2
Looks like a bug.  You'll have to use something like the following, as a work around.
> (format "%% %s %%%s" "hello world" "")
"% hello world %"


P.S. -- Oops, Lutz beat me with another workaround.  Lutz is Quick-Draw McGraw.  :-)
(λx. x x) (λx. x x)

Jeff

#3
Thanks guys!
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code