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

Discussion in 'Ruby' started by James Koppel, Mar 3, 2008.

  1. James Koppel

    James Koppel Guest

    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
    James Koppel, Mar 3, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vijay
    Replies:
    8
    Views:
    689
  2. Roy
    Replies:
    6
    Views:
    578
    Roedy Green
    Jan 7, 2008
  3. Matthew D Moss

    [QUIZ] Hello, world? (#158)

    Matthew D Moss, Mar 1, 2008, in forum: Ruby
    Replies:
    40
    Views:
    380
    Matthew Moss
    Mar 6, 2008
  4. Matthew Moss

    [SUMMARY] Hello, world? (#158)

    Matthew Moss, Mar 7, 2008, in forum: Ruby
    Replies:
    3
    Views:
    142
    Arlen Cuss
    Mar 7, 2008
  5. Larry
    Replies:
    27
    Views:
    409
    Michele Dondi
    Jan 25, 2005
Loading...

Share This Page