Starting with 6.1a2, which includes a completely rewritten "format"
implementation, there is a "%n" format character, which indicates a
newline. 

People so often expect that \n and \t and such should work in Jess
strings that I'm sorely tempted to implement them, even though they
might conceivably breal existing code. Perhaps they could be turned on
or off via a switch. Anybody have opinions here?


I think Chad Loder wrote:
> Here's what we do:
> 
> (defglobal ?*CR* = (call (new java.lang.Character 13) toString))
> (defglobal ?*LF* = (call (new java.lang.Character 10) toString))
> (defglobal ?*TAB*  = (call (new java.lang.Character 9) toString))
> (defglobal ?*CRLF* = (str-cat ?*CR* ?*LF*))
> 
> Then use (str-cat) a lot.
> 
>       (format nil (str-cat "foo bar" ?*CRLF*))
> 
> If anyone has an easier way, please let me know!
> 
>       cy
> 
> 
> On Wed, Jan 29, 2003 at 01:12:05PM -0500, Richard Kasperowski wrote:
> > I want to build strings that have new line characters in them, but 
> > putting \n in my string doesn't do it:
> > 
> > Jess> (format nil "foo bar\n")
> > "foo barn"
> > 
> > I don't want a "foo barn"; that would be a silly barn.  Instead, I want 
> > a "foo bar
> > ".  Is there a way to do this?
> > 
> > Thanks,
> > 
> > -- 
> > Richard Kasperowski
> > Tel: 617-576-1552, Fax: 617-576-2441
> > mailto:[EMAIL PROTECTED]
> > http://www.altisimo.com/
> > 
> > --------------------------------------------------------------------
> > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> > in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> > (use your own address!) List problems? Notify [EMAIL PROTECTED]
> > --------------------------------------------------------------------
> 
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> (use your own address!) List problems? Notify [EMAIL PROTECTED]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to