From: "Peña, Botp" Date: 2002-12-18T20:13:21+09:00 Subject: Re: $SAFE block? Hi sir Nobu (aka nobu.nokada@softhome.net [mailto:nobu.nokada@softhome.net]): You brilliantly wrote on Wednesday, December 18, 2002 6:44 PM: >... > module Kernel > def safe(level) > proc {$SAFE = level; yield}.call (As a nuby,) I didn't know this was possible. Is this ruby way? I presume this is super ruby way then :-) I've modified it to the _nuby_ way, like this (just to see if I'm thinking it right): proc do $SAFE = level; yield end .call And it works still! Very consistent. No surprises for ruby but big happy surprises for us (nubies ;-) I think I better read again on procs and calls :-) > end > end > p Thread.current.safe_level # => 0 > p safe(4) { Thread.current.safe_level } # => 4 > p Thread.current.safe_level # => 0 > > -- > Nobu Nakada > kind regards -botp