Sujet : Re: infix via code walker hook.
De : monnier (at) *nospam* iro.umontreal.ca (Stefan Monnier)
Groupes : comp.lang.lispDate : 04. Apr 2025, 19:17:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <jwvldsfrecv.fsf-monnier+comp.lang.lisp@gnu.org>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13)
1> (parse-infix '(sin a + b + c + d))
(sin (+ (+ (+ a b) c)
d))
>
But, if we put parentheses on the operand of sin, then it's no longer
the unary sin, but a function call with that argument:
>
2> (parse-infix '(sin (a) + b + c + d))
(+ (+ (+ (sin a) b)
c)
d)
For someone coming from "statically typed functional programming", this
is *very* weird.
All those languages (Haskell/OCaml/SML/Coq/Idris/Agda/...) treat
(sin a + b + c + d)
the same as
(sin (a) + b + c + d)
I think it is already better than SRFI-105 curly braces and some
other systems.
A related effort was Honu:
https://users.cs.utah.edu/plt/publications/gpce12-rf.pdf Stefan