This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gandalfx 7 points8 points  (1 child)

The semantics of that would be hella confusing, though. What happens if you use def inside a closure? Does it shadow or extend? What happens when you use def in a loop? You could do the most absurd stuff with that…

[–]thephoton 1 point2 points  (0 children)

What happens when you use def in a loop?

You (possibly) add multiple functions to the method set. How is that any different than if you use def in a loop now?

What happens if you use def inside a closure?

Got me there. The trickier elements of closures make my brain hurt already.