2 ms·
I quite liked this proposal from a while ago: http://shriram.github.io/p4p/ http://shriram.github.io/p4p/ The idea is basically to remove implicit `(begin ...)
by anaphor 7y ago
I quite liked this proposal from a while ago: http://shriram.github.io/p4p/ http://shriram.github.io/p4p/
The idea is basically to remove implicit `(begin ...)` and then remove the trailing parentheses from many things.
For example:
```
(define (f x y)
(* x y))
```
vs.
```
define (f x y)
(* x y)
```
It works because now you can only have a single expression as the body.
Similarly you get the same kind of thing with many other forms that have `begin`.
It also proposes adding some new syntax for various things, replacing `begin` with `do` and a bunch of other stuff related to indentation. You can easily pick and choose which parts you like though and still get some benefit, which is what I like. And it is still homoiconic.
If I wanted a quick and dirty way of making lisp "more readable", then this is what I'd do.
I even created my own half-assed implementation[1] of this idea years ago (In JavaScript). Disclaimer, it's really messy and incomplete code from when I was just learning how to write parsers/lexers/etc. One other idea I implemented was the ability to mix infix and prefix expressions. I'm not sure if I still think it's a good idea, but it worked (it had to know whether a token could be interpreted as a binary operator ahead of time and it was a bit janky, but you could even add your own custom operators)
[1] https://github.com/weskerfoot/JLambda/blob/7508af2c9dcc4db0214853036201211d8fbd09cb/server/fib.jl#L1-L8 https://github.com/weskerfoot/JLambda/blob/7508af2c9dcc4db02...