This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: at sign as symbol name




On 12/28/2014 01:14 PM, Seth Alves wrote:
In r7rs-small, I see this:

     All implementations of Scheme must support the following
     extended identifier characters:
     ! $ % & * + - . / : < = > ? @ ^ _ ~

and other schemes seem okay with it.  Should kawa accept '@ as a symbol?

It does if you specify --r7rs on the command line.

The problem is that @ is used for the splice syntax, which I think is is
more useful than identifiers that start with @.

We could hack '@ so it works, but that doesn't help for unquoted
identifiers.  We could also do something similar that Kawa does for colon:
If @ is followed by a possibly-empty identifier NAME (i.e. @NAME)
we could disambiguate depending on syntactic context (e.g. in define)
and which of NAME or @NAME has an in-scope lexical binding.  That
would be somewhat hackish and not 100% compatible - just like the
colon handling.  I figure if you really want an identifier that
starts with a @ use the --r7rs flag.

I notice that

     (string->symbol "@")

works.

Right, but note that (write (string->symbol "@"))
writes "|@|" (with escapes).

(However, (write (string->symbol ":")) just
writes ":" which is a bug ...)
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]