News for hackers. Stuff that matters.
Re:An Intuition for Lisp Syntax by Viliam1234 on Monday October 26, 2020 @05:02PM (#24901345)
Depending on how frequent are complex equations in your code, you could make a macro for it, and write it e.g. like this:

  (math 5 * f (x + 2))
I might be tempted to do so if I frequently encountered math expressions of depth 3 or more, which in my short Lisp career I didn't.

Also, I would probably rewrite the expression as:

  (* 5 (f (+ x 2)))
to make it easier to read by putting the simple operand first; or in case of two difficult operands I would use formatting:

  (* (f (+ x 2))
     (g (+ x 3)))
Note that a good editor would check that the parentheses match the formatting, so I wouldn't really count that 3 closing parentheses are needed in the last line; they would be inserted automatically.

There are no comments on this comment yet.