From: Kent Dahl Date: 2001-11-05T05:12:18+09:00 Subject: [ruby-talk:24346] Re: block/yield puzzle A little more explanatory: p = proc {|a| print " " + a.to_s } def iter(x) yield x-1; yield x; yield x+1 end iter(5,&p) #=> 4 5 6 iter(5) &p #=> LocalJumpError: yield called out of block When you use the & to make a Proc back into a block, you seem to still have to pass it along as a parameter to the function, you can't just add it to the back like you normally do with an explicit block. -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.�k.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/