go ahead... be a heretic | |
PerlMonks |
Re^10: RFC: Simulating Ruby's "yield" and "blocks" in Perl (Python)by LanX (Saint) |
on Apr 27, 2013 at 15:07 UTC ( [id://1030977]=note: print w/replies, xml ) | Need Help?? |
> As for the second decorator, sure test(lambda a: print("You are in block %s" % a)) will work, not for me...
I suppose the lamda syntax has more restrictions... > 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.
Cheers Rolf ( addicted to the Perl Programming Language)
Update¹) at second thought this would require a possibility to access the arguments of the caller. I suppose the caller is an object where arguments are accessible.
Updatedeleted undiplomatic irony =)
In Section
Meditations
|
|