newLISP Fan Club

Forum => Anything else we might add? => Topic started by: Jeff on June 04, 2007, 09:42:13 AM

Title: Problem in format
Post by: Jeff on June 04, 2007, 09:42:13 AM
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 %%".
Title:
Post by: Lutz on June 04, 2007, 10:02:36 AM
This will be fixed in 9.1.8 (due this weekend). As a workaround use:


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

Lutz
Title:
Post by: rickyboy on June 04, 2007, 10:05:53 AM
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.  :-)
Title:
Post by: Jeff on June 04, 2007, 01:25:15 PM
Thanks guys!