[SOLUTION] [QUIZ] Hello, world? (#158)

J

James Koppel

module Kernel
def meth(&block)
o=Object.new
o.instance_variable_set:)@block,block)
def o.__call(&b)
@block2=b
instance_eval &@block
end
def o.yiel
@block2.call
end
o.method:)__call)
end
end

meth do
yiel
puts "!"
end.call &(meth do
proc do
yiel
print "d"
end
end.call(&meth do
proc do
yiel
print "l"
end
end.call(&meth do
proc do
yiel
print "r"
end
end.call(&meth do
proc do
yiel
print "o"
end
end.call(&meth do
proc do
yiel
print "w"
end
end.call(&meth do
proc do
yiel
print " "
end
end.call(&meth do
proc do
yiel
print ","
end
end.call(&meth do
proc do
yiel
print "o"
end
end.call(&meth do
proc do
yiel
print "l"
end
end.call(&meth do
proc do
yiel
print "l"
end
end.call(&meth do
proc do
yiel
print "e"
end
end.call(&meth do
print "H"
end))))))))))))



-------------------------

I couldn't find a way to truly make blocks accept blocks. Anyone have anything better than my close substitute?



____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top