Given the following snippet:
```
def foo = "foo"
def bar = "bar"
text = "foo"
matches = text in bar
```
The result will be "true", and bar is now a local variable with value
"foo".
If you instead try
```
def foo = "foo"
def bar = "bar"
text = "foo"
matches = text in ^bar
```
You get SyntaxError: "bar: no such local variable"
The only way I've found to be able to do this as a one-liner is with something like:
```
def foo = "foo"
def bar = "bar"
text = "foo"
matches = text in ^(tmp = bar)
```
Anyone else find this behaviour a bit odd?
Show replies by date