in reply to Re^8: RFC: Simulating Ruby's "yield" and "blocks" in Perl (Python)
in thread RFC: Simulating Ruby's "yield" and "blocks" in Perl
If you used a non-keyword such as "send" instead of "yield" you could do Evil and avoid the first decorator. This is left as an exercise. As for the second decorator, sure 'test(lambda a: print("You are in block %s" % a))' will work, but when you require more than one line you're back to using a decorator unless you want to do something truly horrible.
Don't want to do something truly horrible.
-T. "A gentleman is someone who knows how to play the bagpipes but doesn't."
In Section
Meditations