Hacker News new | ask | show | jobs
by kazinator 2 days ago
Also, having them if you want is nice:

  1> let ((x 3) (step 2) (width 5)) ((2 * step + x) mod width)
  2
This is TXR Lisp with auto-infix and auto-compound enabled for the REPL:

  2> *listener-auto-infix-p*
  t
  3> *listener-auto-compound-p*
  t
So we can omit the outermost parentheses, and infix syntax is automatically recognized, freely intermixed with regular Lisp, as if the (ifx ...) macro were wrapped around the input.

I've come up with a very good way of handling infix in Lisp, and documented it in a decent amount of detail as well, not just as a manual for the user but anyone wanting to implement something similar.

https://www.nongnu.org/txr/txr-manpage.html#N-BEB6083E