From: Eric Mahurin Date: 2005-10-10T10:34:36+09:00 Subject: Re: using lambda/Proc can prevent a lot of garbage collection --- Gavin Kistner wrote: > On Oct 9, 2005, at 8:26 AM, Eric Mahurin wrote: > > 2. Proc#binding should give a binding that only has > variables > > that the block accesses (determined when the compiled). > > > > 3. Proc#binding should hold weak references to variables > that > > the block doesn't access (at compile-time). > > I believe that detecting references at compile time is tricky > in a > dynamic language. Is there not a way in Ruby to retrieve a > local > variable whose name is stored in another string? (Perhaps > there isn't. Compile-time meaning compile-time of the block - when the block is created. I think of this as at compile-time, but with the ruby interpreter it may be at run-time. I see no reason why it shouldn't be able to determine what variables a block accesses when it is created - with the exception of eval in the block and eval using Proc#binding. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com