In the following situation, an error will be thrown because slash thinks I want to call the [] method of the Method (bar) that I'm defining, while in reality I want to do something completely different.
def bar {
...;
}
[1, 2, 3].each(\n { n * n });
Produces:
NoMethodError: Undefined method '[]' on #<Method:0xdeadbeef>
...
In the following situation, an error will be thrown because slash thinks I want to call the
[]
method of theMethod
(bar
) that I'm defining, while in reality I want to do something completely different.Produces: