in reply to Re^2: RFC: Simulating Ruby's "yield" and "blocks" in Perl
in thread RFC: Simulating Ruby's "yield" and "blocks" in Perl
FWIW, the equivalent in idiomatic Python3 is:
As for anonymous multiline blocks, a while back a monstrosity was released...def test() print("You are in the method") yield 1 print("You are again back to the method") yield 2 for a in test(): print("You are in the block #{}".format(a))
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: RFC: Simulating Ruby's "yield" and "blocks" in Perl (Python)
by LanX (Saint) on Apr 24, 2013 at 04:19 UTC | |
by MonkOfAnotherSect (Sexton) on Apr 26, 2013 at 10:40 UTC | |
by LanX (Saint) on Apr 26, 2013 at 14:00 UTC | |
by MonkOfAnotherSect (Sexton) on Apr 26, 2013 at 15:13 UTC | |
by LanX (Saint) on Apr 26, 2013 at 17:54 UTC | |
|
In Section
Meditations