Giter Club home page Giter Club logo

Comments (1)

gilch avatar gilch commented on September 27, 2024

Less obviously a good idea, but this reasoning and naming convention, plus the string macro technique from #198 allows for more multiary replacement macros. For example, +s for multiary addition.

I find the use of the star-imported operator suite quite legible, but e.g., add is strictly binary, which feels less Lispy. Maybe we don't need this. add is a lot nicer than XY#.#"X+Y", but once a formula gets even a little complicated, the injection approach wins out. Star imports are also kind of a bad idea in larger projects.

Why not just name it + then? Well, + is really supposed to be a function. #84 removed car and cdr macros because those not being functions was confusing. You should be able to pass + to higher-order functions like map or reduce. Macros don't work like that. You could define or import one with the same name as the macro (one of the features of having a separated macro namespace), which allows the macro to shadow the function when in the function position. But then they probably don't quite work the same way. An alternative would be to just define the function in the prelude. But it kind of already does that by star importing from operator. +s doesn't have this baggage.

Python expression replacements are tier 2 in the inclusion criteria #154, so there is a case for adding them.

from hissp.

Related Issues (20)

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.