This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Splicing lists and vectors into argument lists
- From: Per Bothner <per at bothner dot com>
- To: kawa at sourceware dot org
- Date: Mon, 12 May 2014 14:55:47 -0700
- Subject: Re: Splicing lists and vectors into argument lists
- Authentication-results: sourceware.org; auth=none
- References: <536CFFE6 dot 1080801 at bothner dot com> <m261leksaz dot fsf at gmail dot com> <536E58E7 dot 4040000 at bothner dot com> <m2r441jwoe dot fsf at gmail dot com>
On 05/10/2014 11:49 AM, Helmut Eller wrote:
On Sat, May 10 2014, Per Bothner wrote:
A issue is that initial '@' in a symbol is *not* allowed by R7RS or
R6RS. ('@' is a <special subsequent> so is not allowed as an initial
character.)
Oh boy. They let you put Unicode chars there but no @. Oh wait, they
actually say "it is an error for the first character to have a general
category of Nd, Mc, or Me." But @ belongs to category Po. And again
they use the meaningless phrase "it is an error" which of course only
means that it may or may not be allowed by an implementation.
I just noticed the r7rs errata:
http://trac.sacrideo.us/wg/wiki/R7RSSmallErrata
7, In Section 7.1.1, the lexical rule <special initial> incorrectly omits @.
Since (in my reading) r6rs also allows an initial '@', I think it would be
correct for the --r7rs/--r6rs/--r5rs flags to disable the '@' reader
mapping from @EXPR to ($splice$ EXPR). (r5rs doesn't allow an initial '@',
but allowing it would still be a compatible extension, so for simplify
--r5rs behaves the same.)
So I checked in a fix for this:
$ kawa --r7rs
#|kawa:1|# (define @ 3)
#|kawa:2|# (define @2 2)
#|kawa:3|# (+ @ @2)
5
--
--Per Bothner
per@bothner.com http://per.bothner.com/