From: matz@... (Yukihiro Matsumoto) Date: 2004-02-14T14:17:34+09:00 Subject: Re: return from yielded block Hi, In message "Re: return from yielded block" on 04/02/14, "Ara.T.Howard" writes: |> > def meth s |> > x = |> > block_meth do |> > if s =~ /forty/ |> > return 40 |> > else |> > return 0 |> > end |> > end |> > x + 2 |> > end |> > |> > def block_meth; yield; end |> > |> > p(meth('forty')) # this prints 40 - i want it to print 42 |> |> Use break or next instead of return. |are the semantics _exactly_ the same? No. "break" terminates "block_meth", "next" terminates "yield". matz.