Comments (5)
Since this would be a major departure from how this package works, I think I'll close this in favour of just making a new package: https://github.com/MasonProtter/SimpleUnderscores.jl
from underscores.jl.
Oh that's pretty magical, I didn't know we could return "naked" tuples. Splat at production not consumption. Mathematica has something like this, but I thought Julia didn't.
julia> map(@_ _^2, [1 2 3])
1×3 Matrix{Int64}:
1 4 9
julia> @macroexpand1(@_ _^2, [1 2 3])
:(((var"##x#301"->begin
#= REPL[12]:12 =#
var"##x#301" ^ 2
end), [1 2 3])...)
julia> dump(ans)
Expr
head: Symbol ...
args: Array{Any}((1,))
1: Expr
head: Symbol tuple
from underscores.jl.
I feel quite silly because I've known we could do this for years, but never made the connection that it could be used to bypass JuliaLang/julia#36547
from underscores.jl.
Oh that's pretty magical, I didn't know we could return "naked" tuples.
Is this documented anywhere?
from underscores.jl.
Sounds good!
from underscores.jl.
Related Issues (15)
- A way to allow for `filter`, `map` piping... HOT 3
- Consider capturing bindings by value (FastClosures.jl) HOT 5
- Audit _ expansion rules to only expand into "things which look like function calls" HOT 4
- Assignment gets read as a keyword HOT 3
- @_ within the selector Fun part of DataFrames.select HOT 6
- Feature Request: if no `__` is specified then insert into first argument HOT 9
- Doesn't with ternary operators HOT 3
- Redesign _ -> identity transforms HOT 2
- Broadcasted piping .|> HOT 2
- Release a new version to make new bugfixes avaiable HOT 4
- TagBot trigger issue HOT 1
- Behavior of `_` is confusing with infix operators HOT 15
- Underscore replacement should recurse into quasiquote
- Interaction with indexing brackets HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from underscores.jl.