Comments (3)
Also, if you like this idea, I'm happy to make a PR for this package to add the feature.
from underscores.jl.
Thanks! I know too little of other packages for this stuff so it's nice to see LambdaFn.
It occurred to me that, since this is a macro, you should be able to rewrite piping expressions to treat functions as if they have a curried version.
I do agree this is a tricky problem.
The issue I see with this is that it amounts to a lot of guessing about the user's intentions which I think leads to something less general purpose. For example, we could no longer define Filter(f) = x->filter(f,x)
and use @_ data |> Filter(_+1)
.
I feel like the better solution here would be to be more explicit and allow __
to "escape an extra level", allowing things like
@_ data |>
filter(_>10, __) |>
map(_+1, __)
There may be other options, though.
Overall my aim with this package is to make something which could possibly be included in Base
. So whatever we do, I'd like it to be visually and conceptually consistent with the builtin syntax which has been discussed so much in JuliaLang/julia#24990.
from underscores.jl.
Have a look at latest master; I implemented the __
version and I'm very happy with the result.
BTW, I renamed the package to Underscores.jl
because there's a lot more underscores and richer syntax here than I'd originally imagined. (Also evidence suggests I can no longer type non-pluralized package names :-P )
from underscores.jl.
Related Issues (15)
- 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
- Switch to more local `@_` HOT 5
- 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.