From: Ralph Mason Date: 2001-10-27T16:38:36+09:00 Subject: [ruby-talk:23604] Re: Fast reply needed: class var trouble The thing everyone seems to be missing is that forcing declaration of variables should be optional. A statement in like 'strict' or 'decvars' or some such means that variables must be declared for that source file. Declaring them could perhaps be as simple as placing some punctuation before them the first time they are used. perhaps !a =6 #declare and use then if you dont turn it on it doesn't bother you and if libs you include use it then you wont notice. Those who want to be able to catch thos bugs that not declaring variables causes can use it. Ralph ----- Original Message ----- From: "Robert Feldt" To: "ruby-talk ML" Sent: Saturday, October 27, 2001 6:04 PM Subject: [ruby-talk:23596] Re: Fast reply needed: class var trouble > On Sat, 27 Oct 2001, Ralph Mason wrote: > > > > I'm wondering if you're talking from some bad experiences here, or if > > > this is an observation based on preferences. The reason I ask is that > > > I've been coding Ruby for a fair while now and I've never once felt > > > the need to declare variables. As always, I'm interested in other > > > opinions. But I suspect that this is a change you're unlikely to see, > > > as it would change the character of the language dramatically. > > > > I'm not so sure that it would change the language much at all > > > > something as simple as > > > > var a,b,c,d #define some local variables > > > > a = 6 > > e = 7 #this line give error unknown variable or some such > > > > The need to declare them could be turned at a file level on much like the vb > > 'option expilicit' statement. > > > > It doesn't seem like this would be particularly complicated thing to > > implement. > > > > It really does stop bugs, and any bugs that the language can stop for you is > > a good thing and saves your time. > > > No, no no. Not needing declarations is one of the things making Ruby Ruby > to me. So I could never live with the knowledge that such a change would > have started with a post I did while half a sleep... ;-) > > /Robert > >