Comment by rmunn
3 days ago
Now that I've read through the Common Lisp HyperSpec and realized that there's no standard shortcut syntax for lambda, you have to spell it out every time (or define l as lambda), I'm realizing that yes, that is probably the most common use. I'm also starting to understand why Janet has the `short-fn` macro with special reader syntax for it: |(> $ 0) is short for (lambda (x) (> x 0)), which is SO much less typing. (It also handles multiple arguments: you can say |(> $0 $1) if for some reason you're allergic to just typing > to accomplish the same thing).
In fact, I think next time I'm writing Common Lisp code, I'm going to figure out how to create Janet's | as a reader macro.
FWIW, the common utility library Serapeum offers ‘op’ which it claims is from GOO, which is quite similar as a short positional function utility macro without being a reader macro that has more potential for character clashes: (op (> _ 0)). (But don't let that stop you from recreating it if you wanted to do so for educational purposes!)