chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [CR] Make keywords distinct from symbols


From: Peter Bex
Subject: [Chicken-hackers] [CR] Make keywords distinct from symbols
Date: Mon, 6 May 2019 22:30:14 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

I thought a bit about how nasty it seems that symbols can be used as
identifiers and keywords can't, and decided that it's cleaner to make
keywords and identifiers distinct types at the Scheme level, especially
now that they no longer have a plist.

Some of the defining forms reject keywords now, but there may be some
we missed, and by making them completely distinct we fix these problems
for good. For the vast majority of the code out there this is an
unimportant change. Code which relies on symbol? returning #t for keywords
will run into trouble (but is usually easy to fix by adding another cond
clause for keyword?, which will happily be backwards compatible to older
CHICKENs). There may be other obscure uses of keywords that will fail, but
I can't really think of many.

I've also checked what some existing implementations do:

They're distinct in Gauche (by default, unless some feature macro
is disabled), Racket, Gambit and Guile.

They're a subtype in MIT Scheme and most non-Scheme Lisps.

Chibi, Chez, SCM and Scheme48 do not appear to support keywords.

For this change, I created a Change Request at
https://bugs.call-cc.org/ticket/1613

The patch in the ticket requires that you first make a boot-chicken,
because types.db is not understood by current CHICKEN.  There's no
special bootstrapping required beyond that.  We should probably make
another snapshot after applying.

NOTE: I did *not* change the representation at the C level.  We have
one remaining type tag, so we _could_ do that.  This would make them
even more clearly separated, but I don't think that's worthwhile,
at least not right now.

Please let me know what y'all think.  It might be nice to do this before
releasing 5.1, if we decide to apply the patch.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]