From: Nils Goesche
Subject: character printing
Date: 
Message-ID: <87u27jewjt.fsf@darkstar.cartan>
Hi!

Is the following a bug in CMUCL or am I missing something?  It
works on Allegro Trial...

* (code-char 28)
#\^\
* (prin1 (code-char 28))
#\^\
#\^\
* (read-from-string (prin1-to-string (code-char 28)))

Unexpected EOF on #<String-Input Stream> after escape character.

Restarts:
  0: [abort] Return to Top-Level.

Debug  (type H for help)

(common-lisp::reader-eof-error #<String-Input Stream> "after escape character")
0] 

Regards,
-- 
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.

From: ······@corporate-world.lisp.de
Subject: Re: character printing
Date: 
Message-ID: <92pvsa$t2v$1@nnrp1.deja.com>
In article <··············@darkstar.cartan>,
  Nils Goesche <······@t-online.de> wrote:
> Hi!
>
> Is the following a bug in CMUCL or am I missing something?  It
> works on Allegro Trial...
>
> * (code-char 28)
> #\^\

#\^\  does not make much sense as a character name... Why
is there a second "\" ?

> #\^\
> * (read-from-string (prin1-to-string (code-char 28)))

Does this work:

(read-from-string "#\^\\")

?

Anyway, this looks like a question to the CMUCL maintainers.





Sent via Deja.com
http://www.deja.com/
From: Erik Naggum
Subject: Re: character printing
Date: 
Message-ID: <3187354553612232@naggum.net>
* Nils Goesche <······@t-online.de>
| Is the following a bug in CMUCL or am I missing something?

  It looks like a bug in the printer.  (char-name (code-char 28)) should
  return a string that has one final backslash and prints with two, and so
  the same should be true for the printed representation of the character.

* ······@corporate-world.lisp.de
| #\^\  does not make much sense as a character name...

  Well, the _name_ should be the string "^\\".

| Why is there a second "\"?

  Because ^ is a common modifier character that turns the following
  character into a control character.  ^A is ctrl-A, and ^\ is perfectly
  acceptable as a control character in a context where \ is not escaping
  the following character -- it is, however, in Common Lisp.

#:Erik
-- 
  Performance is the last refuge of the miserable programmer.
From: Nils Goesche
Subject: Re: character printing
Date: 
Message-ID: <87lmsvtdq8.fsf@darkstar.cartan>
······@corporate-world.lisp.de writes:

> In article <··············@darkstar.cartan>,
>   Nils Goesche <······@t-online.de> wrote:
> > Hi!
> >
> > Is the following a bug in CMUCL or am I missing something?  It
> > works on Allegro Trial...
> >
> > * (code-char 28)
> > #\^\
> 
> #\^\  does not make much sense as a character name... Why
> is there a second "\" ?

It's stands for `Ctrl-\'.  When you hit Ctrl-\ on a Unix terminal
with default settings, you send a SIGQUIT to the foreground
process, which usually causes it to terminate and dump core, for
debugging purposes.  (You appear to be using a Mac)

> > #\^\
> > * (read-from-string (prin1-to-string (code-char 28)))
> 
> Does this work:
> 
> (read-from-string "#\^\\")
> 
> ?

No, but this does:

(read-from-string "#\\^\\\\")

> Anyway, this looks like a question to the CMUCL maintainers.

Yes, as Erik Naggum said, it is a bug in the printer, as
expected.  Some kind soul from cmucl.cons.org already sent me a
patch.  I was trying to print out and read back in some character
tables, and was surprised that it didn't work.  I thought that
maybe I was missing some special variable like *print-readably*,
so I'd rather ask here before reporting a bug.

Regards,
-- 
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.