what is printed by this function? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

what is printed by this function?

eidalina20eidalina20 Posts: 8Member
Hey everyone.. i never used Ruby before ... so trying to learn more about it's techniques...
can someone please tell me what will be the output of the following program segment assuming that the [b]puts[/b] function prints its arguament on standard output followed by a newline.

[code]
def h(k)
k.call
puts "in h"
end

def g(k)
h(k)
puts "in g"
end

def f()
callcc {|cc|g(cc)}
puts "in f"
end

f
[/code]

thank you
Sign In or Register to comment.