guile-user
[Top][All Lists]
Advanced

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

Re: Inconsistencies


From: Gary Benson
Subject: Re: Inconsistencies
Date: Thu, 15 Mar 2001 17:18:24 +0000 (GMT)

On Thu, 15 Mar 2001, Martin Grabmueller wrote:

> > From: Gary Benson <address@hidden>
> > Date: Thu, 15 Mar 2001 15:15:42 +0000 (GMT)
> > 
> > Teach Yourself Scheme in Fixnum Days says:
> > 
> > | Scheme symbols are normally case-insensitive. Thus the symbols Calorie 
> > and 
> > | calorie are identical:
> > | 
> > |    (eqv? 'Calorie 'calorie)
> > |    => #t
> 
> According to R5RS, the case of symbols does not matter, so `TYSIFD' is
> right.  Guile (and some other Scheme implementations) do read symbols
> case sensitively, though, by default.  I think this is because most
> people are used to case-sensitive variable names when they come from
> other languages.
> 
> > Guile says:
> > 
> > | guile> (eqv? 'Calorie 'calorie)
> > | #f
> > | guile> (eqv? 'calorie 'calorie)
> > | #t
> 
> You can change Guile's behaviour by switching case-insensitive reading
> on like this:
> 
> guile> (eqv? 'Calorie 'calorie)
> #f
> guile> (read-enable 'case-insensitive)
> (keywords #f case-insensitive positions)
> guile> (eqv? 'Calorie 'calorie)       
> #t
> 
> Note that in most programs this is not a problem, because most Scheme
> programmers never use upper-case letters anyway.

This is often the hardest thing to discover when learning a new
language. The books and tutorials tell you how to write programs but only
looking at other people's code do you discover how _people_ write
programs.

Gary

[ address@hidden ][ PGP 85A8F78B ][ http://inauspicious.org/ ]





reply via email to

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