[ansi-test-devel] read-symbol.13 test?

Tobias C. Rittweiler tcr at freebits.de
Fri Apr 16 22:05:24 UTC 2010


Raymond Toy <toy.raymond at gmail.com> writes:

> In read-symbol.13, the test creates a symbol from a single character and
> expects that the symbol-name of the symbol is exactly the same as
> specified character.
>
> CMUCL fails this test because intern, make-symbol, and friends convert
> the string to Unicode NFC form first.  This conversion usually produces
> the same string, but, for example, #\Combining_Grave_Tone_Mark (U+0340)
> produces the symbol whose name is #\Combining_Grave_Accent.
>
> I couldn't find anything that says that the string name of the symbol
> must be exactly the same as the given string.
>
> Ray

How do you read the dictionary entry for INTERN differently than saying
that?

  intern enters a symbol named string into package. If a symbol whose
  name is the same as string is already accessible in package, it is
  returned. If no such symbol is accessible in package, a new symbol
  with the given name is created ...

  It is implementation-dependent whether the string that becomes the new
  symbol's name is the given string or a copy of it. Once a string has
  been given as the string argument to intern in this situation where a
  new symbol is created, the consequences are undefined if a subsequent
  attempt is made to alter that string.


The only thing is that I'm not sure the reader is specified to use
INTERN. 2.3.4 Symbols as Tokens says

  When parsing the syntax for a symbol, the Lisp reader looks up the
  name of that symbol in the current package. ... If the name is found,
  ... If the name is not found (that is, there is no symbol of that name
  accessible in the current package), a new symbol is created and is
  placed in the current package as an internal symbol. ... If the name
  is later read again while this same package is current, the same
  symbol will be found and returned.

I still doubt you can read that as implying anything else.

  -T.





More information about the ansi-test-devel mailing list