From: "David A. Black" Date: 2005-05-09T19:05:34+09:00 Subject: Re: No Thing Here vs Uninitialized and RCR 303 Hi -- On Mon, 9 May 2005, John Carter wrote: > On Mon, 9 May 2005, David A. Black wrote: > >> Do you mean there's a convention of initializing variables to nil, prior to >> (say) their use as iterator variables or counters? If so, that's very >> different from an uninitialized variable. > > Let me bounce that question back to you... > > When _you_ personally do that, what do you mean? Do you mean "This is ruby's, > umm, curious way of declaring local variables, namely by initializing them to > something. I am initializing this local variable to nil. By this I, David A. > Black mean (tick one) > > a) This local variable is uninitialized and I wish ruby to throw an Clearly I can't regard it as uninitialized, if I've just initialized it. > error if I invoke a method on it before initializing it to > something meaningful. You can't initialize a variable twice. The second time around it's just "assignment" :-) [...] > I can, and am currently writing a Nothing class that allows me to > assign NOTHING, the sole instance of my Nothing class to a local > variable in the case you describe. I understand the goal of your project; I only mean to encourage you to start from the clearest possible understanding of what the language does -- specifically, that variables you have initialized to nil are not uninitialized. If you use the term "uninitialized" to describe the x in "x = nil", I think snags in terminology and/or logic may follow later on. David -- David A. Black dblack@wobblini.net