From: David E. Duman
Subject: help... I need to put " in a file
Date:
Message-ID: <59c87d$ic1@news.ysu.edu>
I am new to lisp (common lisp), and I am writing a program
that needs to print the single and double quote characters
into a file. I can't find the filter or anything like that
to allow me to simply write such things.
If anyone has some ideas on that, I would appreiate a reply.
Thanks in advance:
----------------------------
·····@clem.mscd.edu
--
David Duman
Denver, CO
·····@yfn2.ysu.edu
From: Will Ware
Subject: Re: help... I need to put " in a file
Date:
Message-ID: <E2p9tp.nA@world.std.com>
David E. Duman (·····@yfn.ysu.edu) wrote:
: I am new to lisp (common lisp), and I am writing a program
: that needs to print the single and double quote characters
: into a file. I can't find the filter or anything like that
: to allow me to simply write such things.
In gcl:
>(format t "'")
'
NIL
>(format t "~a" #\")
"
NIL
>(format t "~c" #\")
"
NIL
I would have hoped for a cleaner way to do the double-quote, but
looking thru CLTL2, I don't see one. As far as printing this stuff
to files, change "format t" to "format outfile" where "outfile" is
a stream created with the "open" command. Best of luck.
--
-------------------------------------------------------------
Will Ware <·····@world.std.com> web <http://world.std.com/~wware/>
PGP fingerprint 45A8 722C D149 10CC F0CF 48FB 93BF 7289
In article <·········@world.std.com>, ·····@world.std.com (Will Ware) wrote:
> David E. Duman (·····@yfn.ysu.edu) wrote:
>
> : I am new to lisp (common lisp), and I am writing a program
> : that needs to print the single and double quote characters
> : into a file. I can't find the filter or anything like that
> : to allow me to simply write such things.
>
> In gcl:
> >(format t "'")
> '
> NIL
>
> >(format t "~a" #\")
> "
> NIL
>
> >(format t "~c" #\")
> "
> NIL
>
> I would have hoped for a cleaner way to do the double-quote, but
> looking thru CLTL2, I don't see one. As far as printing this stuff
> to files, change "format t" to "format outfile" where "outfile" is
> a stream created with the "open" command. Best of luck.
For a character: (write-char #\")
For a string: (princ "\"")