Case sensitivity

Steven Taschuk staschuk at telusplanet.net
Tue Feb 25 18:57:25 CET 2003


Quoth Alex Martelli:
> Terry Reedy wrote:
  [...]
> > Is it still possible to add '-' as a name (and re-word) character?  Or
> > does the implementation in C somehow prohibit this by requiring
> > conformance to C's name rule?
> 
> Today, a-b does a subtraction between the value named by a and the
> value named by b.  If you want to turn that into a 3-character
> identifier, and force subtraction to be spelled as "SUBTRACT b
> FROM a", I _do_ suspect you'll be better off with Cobol, really.

And likewise, if - is allowed identifier-initially, -a no longer
causes unary negation.

(- in identifiers works in Lisp at least in part because these
syntactic oddities do not arise: subtraction is (- a b) and unary
negation is (- a), I think.)

> If what you want is mandatory space between tokens, so a-b is a
> name but a - b is a subtraction -- hmmm, Dylan has that, and it
> kept tripping me up.  I think it's a trap, an accident waiting to
> happen, and overall a language defect, [...]

Hear, hear.

-- 
Steven Taschuk                             staschuk at telusplanet.net
"I may be wrong but I'm positive."  -- _Friday_, Robert A. Heinlein





More information about the Python-list mailing list