Comments (1)
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)
- `deftype` should be able to take `kwds`
- one time donations problem, please try receive some crypto as donation, maybe nano cryptocurrency
- Rethink `if-else` HOT 12
- Consider inject literals in Lissp (raw symbols) HOT 3
- Gensysms aren't good enough HOT 4
- Build broke on Python 3.11
- Synexpand may be too sensitive HOT 1
- & doesn't factor well in synexpand HOT 7
- Consider making gensym counter a reader instance variable
- Add source links to macros.lissp HOT 1
- defonce defs twice?
- #241 broke synexpand
- Dill integration HOT 1
- Consider munging `-` as `QzH_` instead of `Qz_`
- Consider a shorter name for `_macro_` HOT 2
- Write a symbol macro let walkthrough
- Stop supporting Python 3.8
- Compiled lambda text layout could be improved HOT 5
- Use terminology more consistently
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 hissp.