guile-user
[Top][All Lists]
Advanced

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

Re: defining new character names?


From: Lars J. Aas
Subject: Re: defining new character names?
Date: Wed, 21 Aug 2002 11:17:54 +0200
User-agent: Mutt/1.3.24i

Matthias Koeppe <address@hidden> wrote:
: "Lars J. Aas" <address@hidden> writes:
: 
: > The most "transparent" solution would be to allow
: >
: >   (define #\paren-close #\051)
: >
: > [If the first token looks like a character constant, the second must
: > be one too?]  Would that be possible to implement without any overhead
: > on the define implementation?  Would it break something?
: 
: It would break everything.
: 
: DEFINE does not operate on "tokens".  You seem to be missing that
: there are two phases when you feed forms into Guiles:

Sorry if I come across as a moron here ;)  I know it would only work
if define was handled closely integrated with the reader, which I now
know it obviously is not.

: What I think _would_ be useful for Guile is a new DEFINE form that
: creates constant variables, like DEFINE-CONSTANT, so you could say
:         
:    (define-constant paren-close-char (integer->char 41)).
: 
: This may serve useful for compiler optimizations, because the compiler
: (if any) could assume that the value of the variable never changes.

Yes, this would be nice - it could perhaps also help catch bugs by throwing
exceptions when constants are tried modified.

Anyways, what I feel would be nice is to have modify/extend-access to
the reader's table of #\... character keywords, so I wouldn't be limited
to the existing set defined in libguile/chars.c.  Anyways, I'll have
to do without it for now obviously.  I'll leave it up to you Guile
wizards to decide on whether this would be something worth adding to a
future version of Guile or not.

  Lars J




reply via email to

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