From: dblack@... Date: 2003-05-09T07:01:04+09:00 Subject: Re: Can a global be a constant? Hi -- On Fri, 9 May 2003, Jim Freeze wrote: > Hi > > I just noticed this (after 2 yrs). It appears that a > capitalized global is not considered a constant. > > $D = true # ok > $D = false # ok > F = true # ok > F = false # -:4: warning: already initialized constant F > > Why is this? Because a capitalized global variable is a variable :-) Same thing with instance variables: $ ruby -e "A=1; A=2; @B=1; @B=2" -e:1: warning: already initialized constant A Once something doesn't begin with [A-Z], it can't be a constant. David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav