[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reserved keywords
- From: Reuben Thomas <rrt@...>
- Date: Tue, 25 Nov 2003 23:21:06 +0000 (GMT)
> mytable = {}
> mybool = true
> mystring = "true"
> mytable[mybool] = 1
> mytable[mystring] = 2
> print(mytable.true)
This doesn't illustrate much. You wouldn't expect mytable.true ever to
mean mytable[true], because that's not what dot-sugar does.
FWIW I agree that allowing keywords to be used like this is probably a bad
idea, because it's confusing when you do it wrong and get weird errors.
Best simply not allow keywords anywhere as barewords except when they are
being used as keywords, and (as pointed out earlier) be consistent with
other languages.
--
http://www.mupsych.org/~rrt/ | egrep, n. a bird that debugs bison