This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: at sign as symbol name
- From: Per Bothner <per at bothner dot com>
- To: kawa at sourceware dot org
- Date: Sun, 28 Dec 2014 14:29:01 -0800
- Subject: Re: at sign as symbol name
- Authentication-results: sourceware.org; auth=none
- References: <54A072BC dot 2070203 at hungry dot com>
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/