Re: [Scheme-reports] r7rs-draft-6: identifiers looking as numbers
Ray Dillinger 13 May 2012 18:45 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/09/2012 08:36 PM, Daniel Villeneuve wrote:
> The draft says: "An identifier is any sequence of letters, ...
> provided that it does not have a prefix which is a valid number."
> But in our implementation, a symbol can match the following
<clip>
> The following identifiers are therefore legal:
>
> 100-in-30-window 1-in-7-window-domestic
> 1-in-7-window-international
I have not tested recently, but as of a few years ago, there were
several major implementations that considered any sequence of
printing characters which didn't parse according to the rules for
numbers, characters, strings, etc, to be an identifier.
My own parser uses a rule that identifiers cannot *both* begin
with a sign, digit or decimal point, *and* end with a digit or
decimal point. This is on the assumption anything which does
both begin and end with such a character is syntax that I may
eventually want to use for some kind of number.
Both of those approaches treat all of the above as legal
identifiers.
Also, despite what the standard says, I see specific procedures
named 1+ and 1- used in a lot of code apparently intended to be
portable. In fact the prevalence of these identifiers influenced
the definition of identifiers in my own parser. If not for them,
the rule would be simpler: that identifiers may not both begin
and end with a sign, decimal point, or digit.
The standard has not historically forbidden such extensions to
identifier syntax. I don't see a compelling reason why it should
do so now.
Bear
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJPsAFbAAoJEAOzWkqOibfNrG8H/04Hv/IEowmpS2mL9WX8li+a
1lnR/V5l2OkI/cHFsGBiF/A3/oPjfQLYhWElDKzvb0O014ABg57rG1hUJJ9cecJo
8JvhJpGUVeNAv7PZDcoNA/EltzPfbhdrtJWd8+JL8AaDjf+ybpKxhFRNF2bLsh4w
APwsEDjWcFiUsQ20THKgOwF75GmcTgr0wklgZKasd9cgWkWS31JZqYcplvGre5PP
PPCnBl14x9+86OTzN3Jrw/gVWJhyESaLP4pkRm+qPQCdTzSNJLkrwAEcptWUbYw4
pYqWwfSwD/PUNc1zhB1JlAB/gDRKIafmGY8qL1X+SgFKSmRPhSslqVCfConLZx8=
=QlSr
-----END PGP SIGNATURE-----
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports