From: Tanaka Akira Date: 2002-07-27T02:47:29+09:00 Subject: [ruby-dev:17846] Re: new mathn [Re: Rational#to_int ← String#center] In article <200207261056.TAA02094.keiju@ishitsuka.com>, keiju@rational.com ($B@PDM7= $B%m!<%+%kJQ?t$rMQ$$$kJ}K!$O(B, ScopeStak$B$NF,$N>uBV8BDj%9%3!<%W$rMQ$$$k$N(B > $B$G$O$J$/(B, $B$=$N%m!<%+%kJQ?t$KEPO?$5$l$?>uBV8BDj%9%3!<%W$rMQ$$$l$PNI$$$s(B > $B$8$c$J$$$+(B? $B$C$F$3$H$@$H;W$&$N$G$9$,(B, $B>uBV0MB8%a%=%C%IFb$+$i$=$NJQ?t$r(B > $B%"%/%;%9$G$-$^$;$s$N$GIT2DG=$G$9(B. % ruby -e ' def set(val, &b) Thread.current[:__scope_in_state_scope_stack] = val eval("__scope_in_state_scope_stack = Thread.current[:__scope_in_state_scope_stack]", b) Thread.current[:__scope_in_state_scope_stack] = nil end def get(&b) eval("if defined? __scope_in_state_scope_stack then __scope_in_state_scope_stack else nil end", b) end p get {} set(1) {} p get {} set(2) {} p get {} p eval("__scope_in_state_scope_stack") ' nil 1 2 2 $B$H$$$&$h$&$J$b$N$rA[Dj$7$F$$$^$9!#(B > # $B:#OCBj$K$J$C$F$$$k(Bbinding$B$N%9%?%C%/$r8+$l$l$PJL$+$bCN$l$^$;$s$,(B... $B$o$?$7$O!"IT2DG=$G$O$J$$!"$HH=CG$7$F$^$9!#$+$J$j6$0-$G$9$,!#(B -- [$BEDCf(B $BE/(B][$B$?$J$+(B $B$"$-$i(B][Tanaka Akira] $B!V$U$($m(B! $B$o$+$a$A$c$s:n@o$G$9$(C"=$B!W(B(Little Worker, $B7KM7@84](B)