From: Austin Ziegler Date: 2003-12-30T03:42:40+09:00 Subject: Re: Defining/Deleting variables On Mon, 29 Dec 2003 10:46:49 +0900, GGarramuno wrote: > Couple of reasons: > 1) Memory > While setting the variable to an empty class object would likely work for > most cases, some scripting languages make the distinction so that the > memory manager will not do more work than needed when either the memory > can be reused somewhere else or when the memory will be reused by the > same object to fill it back again. This is not a reason to worry about this with Ruby. Variables aren't memory slots, they are "tags." Objects hold the memory slots, and aren't released for GC until there are no more references held to them. > 2) Avoid namespace clashes > In the past day or so I've been playing with ruby, I read about ruby's > design flaw regarding local scopes. If a variable could be removed from > scope, it would perhaps be a way of addressing some potential pitfalls, > but I guess not. I don't know that I'd call it a design *flaw*, but a design *decision* that's being changed moving forward :) -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.12.29 * 13.25.01