JuliaLang/julia — pull request #5734 by porterjamesj (2014-02-08 17:24:13+00:00)
Title: RFC: @as macro for expression chaining.

This implements the `@as` macro, mostly as described in #5571.

I wasn't sure where to put the tests for this, I can add them if someone will let me know.

Some examples:

```julia
@as x begin
3
x^2
mod(x,4)
end
# => 1
```

```julia
@as _ "julia\n" |> chomp(_) |> _ + reverse(_)
# => "juliaailuj"
```

One thing I have not done yet is @cdsousa's idea of automatically expanding `f` to `f(_)`; I can add it if we decide we want this.

This also might be pretty brittle, I doubt I've thought of all the edge cases. Would appreciate some tire kicking / feedback, I am still an egg when it comes to writing macros :)