[#300] Ruby 1.3.3-990507 — matz <matz@...>
Ruby 1.3.3-990507 is out, check out:
1 message
1999/05/07
[#314] Arity features for Proc object? — matz@... (Yukihiro Matsumoto)
A mail from <yeboah@tu-harburg.de> is somehow rejected by the list
12 messages
1999/05/17
[#315] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
[#316] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00315] Re: Arity features for Proc object?"
[#318] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#319] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00318] Re: Arity features for Proc object?"
[#320] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#323] binding — Pros Yeboah <yeboah@...>
Hi
5 messages
1999/05/18
[#357] thinking aloud — "Bryce Dooley" <thecrow@...>
First off, I think Ruby is a very nice scripting language.
7 messages
1999/05/29
[ruby-talk:00328] Re: binding
From:
gotoken@... (GOTO Kentaro)
Date:
1999-05-19 09:41:08 UTC
List:
ruby-talk #328
Hi
In message "[ruby-talk:00323] binding"
on 99/05/18, Pros Yeboah <yeboah@tu-harburg.de> writes:
>Can someone please explain to me the meaning and usage of
>1)the built-in method binding.
>2)the Kernel method callcc.
I picked up two uses of callcc from Japanese speaking list.
hope this helps...
#
# callcc example 0 -- infinite loop [ruby-list:13688]
#
def Loop
callcc {|c| $c = c }
yield
$c.call
end
Loop { print "hello\n"; sleep 0.5 }
# end of example 0
#
# callcc example 1 -- cursor [ruby-list:13696]
#
class Cursor
def initialize(iter)
@iter = iter
@cont = nil
end
def next
callcc{|@cc|
@cont.call if @cont
@iter.call {|obj|
callcc{|@cont| @cc.call(obj) }
}
@cc.call(nil)
}
end
end
c = Cursor.new(["deep","space","nine"].method(:each))
p obj = c.next
p obj = c.next
p obj = c.next
p obj = c.next
# end of example 1
-- gotoken