[Top][All Lists]

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

Re: defining new character names?

From: rm
Subject: Re: defining new character names?
Date: Thu, 22 Aug 2002 09:42:59 +0200
User-agent: Mutt/1.3.24i

On Thu, Aug 22, 2002 at 12:16:24AM -0500, Lynn Winebarger wrote:
> On Wednesday 21 August 2002 23:12, Keith Wright wrote:
> > I endorse everthing Ralf said about the need for multiple
> > names for multiple purposes, without prejudice to the
> > question of whether any of it is any good at all.
> > 
> > >       As for constants, there's no reason to believe we want
> > > character names to be constant.  There's plenty of reason
> > > to consider forms for setting constants, but this is not one of
> > > them.
> > 
> > What is a settable constant if not a variable?
>       By setting constants, I meant binding a name to a value
> and that value not being allowed to change during its lifetime.
> It's not quite the same as a "settable constant".

Hmm, but where then is the difference to a plain ol' variable?
A variable is a symbolic name that stands for 'something'. That
'something' can be changed (by means of 'set!', for example), even
so most functional programmers try to avoid it.

> > 
>      Beauty's in the eye of the beholder.  Maybe they like Perl.
>      If you considered my last email's proposal of making character
> names be variables evaluated in "character space", it might even
> be useful for switching charactersets on the fly.  Slow, but it could
> work.  Just swap in an entirely different table, and boom, the same
> lambda will use different integers for the same character names. 
> Of course, I don't know much about that problem, so that solution 
> might not be useful at all.

This is exactly what variables are for. It seems to me that what you
suggest is: #\abcd is a variable that can be changed during program
run time (where the '#\' part of the symbol is just an indication that
the 'something' that is bound to it is a character). This has two

 - you leave scheme's weak typing system (where a variable
   can be bound to things of different type). There's nothing
   like "character space" is scheme, as much as there isn't a
   "function space" (as there is in LISP).
 - You leave rNrs: the character sequence '#\' is reserved to
   start a character constant (r5rs, Section 6.3.4). 

>        My own attempt at facetiousness.  Dybvig's put the whole thing
> on, so you don't have to rely on my little outtake.  He 
> puts it under the heading of I/O control operations.

Thank's for the pointer, i'll have to check that. Strange, i'm getting
really curious to see how Chez does this.


> Lynn
> _______________________________________________
> Guile-user mailing list
> address@hidden

reply via email to

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