Git Product home page Git Product logo

Comments (3)

haberdashPI avatar haberdashPI commented on May 15, 2024 1

Also, if you like this idea, I'm happy to make a PR for this package to add the feature.

from underscores.jl.

c42f avatar c42f commented on May 15, 2024

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.

c42f avatar c42f commented on May 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.