From: Mohammad Pourheidari
Subject: preserving newlines in strings
Date: 
Message-ID: <640009@hpclmp.HP.COM>
Is there a way to preserve newlines in a string that is the argument to 
the function read-from-string?

For example given:

(read-from-string "(defun foo (x y)
                      (+ x y))")

should return:

(DEFUN FOO (X Y)
(+ X Y))



thanks, M.
From: Ulf Dahlen
Subject: Re: preserving newlines in strings
Date: 
Message-ID: <1662@majestix.liu.se>
In article <······@hpclmp.HP.COM> ········@hpclmp.HP.COM (Mohammad Pourheidari) writes:
>Is there a way to preserve newlines in a string that is the argument to 
>the function read-from-string?
>
>For example given:
>
>(read-from-string "(defun foo (x y)
>                      (+ x y))")
>
>should return:
>
>(DEFUN FOO (X Y)
>(+ X Y))

The function READ-FROM-STRING acts like READ but takes its input from
a string. In your example READ-FROM-STRING returns a list. The line
breaks in the output of lists are inserted by the PRINT function. You
might try the function PPRINT if you want "better looking" output. In
any case, this is implementation dependent.

__________
Ulf Dahlen, ···@ida.liu.se, ···@liuida.UUCP
Dept of Computer & Info Science, University of Linkoping, Sweden

1981: The BBC Micro by Acorn:  Standard hardware with excellent software.
1987: The Archimedes by Acorn: Excellent hardware with yesterday's software.
Sad, isn't it?