hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Wednesday

2005.07.27

Block and Lambda #

by babie in inspect

This entry is a loose summary of Matz blog : 2005-06-30 , 2005-07-01 , 2005-07-21 , 2005-07-22 . And this entry is related to Ruby 2.0 block local variable and Function Call .

Matz has been thinking about new syntax of block paremter and lambda expression. As it stands, we can’t use same syntax in block parameter as in method parameter. So he has some ideas, but he is not satisfied with these ideas.

Continue to full post. (474 words)

Lambda is a $SAFEcracker #

by why in inspect

MenTaL sends this one in:

 pr = lambda { puts "Safelevel: #$SAFE" }
 $SAFE = 4
 pr.call
 1.times(&pr)

Bug or feature? Anyone want to help us out here? Globals are thread-local, so it’s not the case with other globals. So what makes $SAFE so special? (Seen on ~sasada.)