unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Lisp reader bug
@ 2003-04-04 11:24 Kenichi Handa
  2003-04-04 17:08 ` Kim F. Storm
  2003-04-05  8:12 ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Kenichi Handa @ 2003-04-04 11:24 UTC (permalink / raw)


Emacs of CVS HEAD has a bug in Lisp reader.  For instance,

(read (format "'%c" (decode-char 'ucs #x102)))
=> (quote )

I'm not sure, but perhaps this change is the cause.

2003-02-18  Kim F. Storm  <storm@cua.dk>

	* lread.c (read1): Fix last change.
	"`" is not always special.  Allow "?" after a character constant.

This change adds codes something like this (total 4 places):

	  || index ("\"';([#?", next_next_char)

but, it seems that `index' doesn't work well if the second
arg is greater than 0xFF.  Actually, if I change such lines
to:

	  || (next_next_char < 0x100 && index ("\"';([#?", next_next_char))

the bug disappears.

Kim, could you take a look at this problem?

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Lisp reader bug
  2003-04-04 17:08 ` Kim F. Storm
@ 2003-04-04 15:53   ` Andreas Schwab
  2003-04-09  7:14   ` Kenichi Handa
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2003-04-04 15:53 UTC (permalink / raw)
  Cc: Kenichi Handa

storm@cua.dk (Kim F. Storm) writes:

|> Kenichi Handa <handa@m17n.org> writes:
|> 
|> > Emacs of CVS HEAD has a bug in Lisp reader.  For instance,
|> > 
|> > (read (format "'%c" (decode-char 'ucs #x102)))
|> > => (quote )
|> > 
|> > I'm not sure, but perhaps this change is the cause.
|> > 
|> > 2003-02-18  Kim F. Storm  <storm@cua.dk>
|> > 
|> > 	* lread.c (read1): Fix last change.
|> > 	"`" is not always special.  Allow "?" after a character constant.
|> > 
|> > This change adds codes something like this (total 4 places):
|> > 
|> > 	  || index ("\"';([#?", next_next_char)
|> > 
|> > but, it seems that `index' doesn't work well if the second
|> > arg is greater than 0xFF.  Actually, if I change such lines
|> > to:
|> > 
|> > 	  || (next_next_char < 0x100 && index ("\"';([#?", next_next_char))
|> > 
|> > the bug disappears.
|> > 
|> > Kim, could you take a look at this problem?
|> 
|> I'm not aware of that limitation in `index' (it is not documented),

The POSIX standard says that index shall be equivalen to strchr, and the C
standard says that strchr converts its second argument to char before the
comparison.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Lisp reader bug
  2003-04-04 11:24 Lisp reader bug Kenichi Handa
@ 2003-04-04 17:08 ` Kim F. Storm
  2003-04-04 15:53   ` Andreas Schwab
  2003-04-09  7:14   ` Kenichi Handa
  2003-04-05  8:12 ` Richard Stallman
  1 sibling, 2 replies; 6+ messages in thread
From: Kim F. Storm @ 2003-04-04 17:08 UTC (permalink / raw)
  Cc: emacs-devel

Kenichi Handa <handa@m17n.org> writes:

> Emacs of CVS HEAD has a bug in Lisp reader.  For instance,
> 
> (read (format "'%c" (decode-char 'ucs #x102)))
> => (quote )
> 
> I'm not sure, but perhaps this change is the cause.
> 
> 2003-02-18  Kim F. Storm  <storm@cua.dk>
> 
> 	* lread.c (read1): Fix last change.
> 	"`" is not always special.  Allow "?" after a character constant.
> 
> This change adds codes something like this (total 4 places):
> 
> 	  || index ("\"';([#?", next_next_char)
> 
> but, it seems that `index' doesn't work well if the second
> arg is greater than 0xFF.  Actually, if I change such lines
> to:
> 
> 	  || (next_next_char < 0x100 && index ("\"';([#?", next_next_char))
> 
> the bug disappears.
> 
> Kim, could you take a look at this problem?

I'm not aware of that limitation in `index' (it is not documented),
but if that's the case, your fix is appropriate...  Please install it
if not already done.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Lisp reader bug
  2003-04-04 11:24 Lisp reader bug Kenichi Handa
  2003-04-04 17:08 ` Kim F. Storm
@ 2003-04-05  8:12 ` Richard Stallman
  2003-04-09  7:18   ` Kenichi Handa
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2003-04-05  8:12 UTC (permalink / raw)
  Cc: emacs-devel

    Emacs of CVS HEAD has a bug in Lisp reader.  For instance,

    (read (format "'%c" (decode-char 'ucs #x102)))
    => (quote )

Is that a bug?  I am not sure.  What do you think correct behavior
would be?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Lisp reader bug
  2003-04-04 17:08 ` Kim F. Storm
  2003-04-04 15:53   ` Andreas Schwab
@ 2003-04-09  7:14   ` Kenichi Handa
  1 sibling, 0 replies; 6+ messages in thread
From: Kenichi Handa @ 2003-04-09  7:14 UTC (permalink / raw)
  Cc: emacs-devel

In article <5xwuiab37d.fsf@kfs2.cua.dk>, storm@cua.dk (Kim F. Storm) writes:
> I'm not aware of that limitation in `index' (it is not documented),
> but if that's the case, your fix is appropriate...  Please install it
> if not already done.

Just done.

Andreas Schwab <schwab@suse.de> writes:
> The POSIX standard says that index shall be equivalen to strchr, and the C
> standard says that strchr converts its second argument to char before the
> comparison.

Thank you for confirming it.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Lisp reader bug
  2003-04-05  8:12 ` Richard Stallman
@ 2003-04-09  7:18   ` Kenichi Handa
  0 siblings, 0 replies; 6+ messages in thread
From: Kenichi Handa @ 2003-04-09  7:18 UTC (permalink / raw)
  Cc: emacs-devel

In article <E191imp-0005UD-00@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:
>     Emacs of CVS HEAD has a bug in Lisp reader.  For instance,
>     (read (format "'%c" (decode-char 'ucs #x102)))
>     => (quote )

> Is that a bug?  I am not sure.  What do you think correct behavior
> would be?

The correct behaviour is that the 2nd element of the
returned list a symbol whose name is the same as:
  (string (decode-char 'ucs #x102))
That is also the behaviour of the previous Emacs.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-04-09  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 11:24 Lisp reader bug Kenichi Handa
2003-04-04 17:08 ` Kim F. Storm
2003-04-04 15:53   ` Andreas Schwab
2003-04-09  7:14   ` Kenichi Handa
2003-04-05  8:12 ` Richard Stallman
2003-04-09  7:18   ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).