From: Sean O'Dell Date: 2004-06-16T05:38:45+09:00 Subject: Re: undefine On Tuesday 15 June 2004 11:45, Mark Hubbart wrote: > On Jun 15, 2004, at 10:19 AM, tony summerfelt wrote: > > On Tue, 15 Jun 2004 14:55:05 +0900, you wrote: > >>> I did not advocate removing, a.k.a. undefining, > >>> instance variable, > > > > it would be a local variable i'd be undefining, probably not an > > instance variable (although i'd like that option also) > > I think the whole point here is that it isn't Ruby-ish to rely on a > variable being defined or not. Ruby wassn't built to do things in that > way; a couple examples in this thread show how variables are > automagically defined when code is parsed. They aren't defined at > runtime, they are defined at eval time. So basically, If you are > translating code from Perl that undefines local variables, you will > have to find a different way of doing it, due to the way Ruby was > designed. I doubt that this is likely to change, because it's part of > how Ruby was designed. Actually, Matz could probably very easily expose variables as objects themselves to be manipulated like anything else in Ruby. I don't think because he hasn't done it yet constitutes a "design decision" as much as "something he didn't do." It's not impossible, in other words, it's just a feature that doesn't exist yet. Sean O'Dell