I made a small utility library named
Wormhole.
The library enables us to communicat
Here is a simple example of use.
1 require 'rubygems' 2 require 'wormhole' 3 4 def foo(array) 5 array << :foo # (1) 6 Wormhole.throw array 7 array << :baz # (3) 8 end 9 10 result = Wormhole.catch do 11 foo [] 12 end.return do |array| 13 array << :bar # (2) 14 end 15 puts result.inspect # => [:foo, :bar, :baz]
First, the block passed to Wormhole.c
By using this utility, you can participat
At the end, you can install this utility from the GitHub by using gem command like this.
1 % sudo gem sources -a http://gems.github.c om 2 % sudo gem install genki-worm hole
Have fun!
posted by
takiuchi
on Sat 5 Jul 2008
at 01:53
with
2 comments