Methods cannot be invoked from within lambdas or blocks
-
Philipp Pirozhkov
class Foo def a(x, lambda) ['inside a', x].join(' ').puts() lambda() ['exiting a', x].join(' ').puts() def b(y) ['inside b', y].join(' ').puts() def z 'z'.puts() a('do something', fun do b('ccc') ) 'exit z'.puts() -
Tony Arcieri
- Title changed from class method is not seen inside a block to Methods cannot be invoked from within lambdas or blocks
Lambdas should be able to access (but not mutate) the outer scope and hidden ivar state.
I'll add support for this, with the provision that if a method is invoked which mutates the state it will crash the object.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.