From: Ryan Davis Date: 2012-10-11T06:01:49+09:00 Subject: Re: goto function? On Oct 10, 2012, at 03:05 , Peter Zotov wrote: > Eric Christopherson писал 10.10.2012 02:12: >> On Tue, Oct 9, 2012 at 4:45 PM, Frédéric Lemire wrote: >> ... >>> I like cleanliness and modularization, but I also like to have the eval >>> command, and metaprogramming stuff to explore sometimes unexpected ways. >>> So, why not a goto command ? >>> >>> It's neat to be able to get dirty when one needs it and feels confident >>> about it ! >>> >>> Anyway… for now, I'll just make exceptions to my indentation fixation, >>> waiting for a freer future. >> >> You can use continuations (although I think I recall hearing that they >> were either removed or dumbed down in 1.9). > > They were, in fact, added in 1.9. No, they were added MUCH earlier than 1.9. >> RUBY_VERSION => "1.8.7" >> callcc {} => nil In fact, way way earlier than that: 10024 % cd ruby_1_4 10025 % ag callcc ./ChangeLog 2301: * eval.c (rb_callcc): call scope_dup() for all scopes in 3127: * eval.c (rb_callcc): experimental continuation support. ./eval.c 7518:rb_callcc(self) 7616: rb_define_global_function("callcc", rb_callcc, 0);