Sujet : Re: infix via code walker hook.
De : monnier (at) *nospam* iro.umontreal.ca (Stefan Monnier)
Groupes : comp.lang.lispDate : 04. Apr 2025, 21:33:12
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <jwv4iz3r7rm.fsf-monnier+comp.lang.lisp@gnu.org>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13)
Ah, but how about higher precedence operators?
Same: the "usual" convention in those languages (and in most λ-calculus
papers) is that function application takes the shape "e1 e2" and binds
tighter than "anything else".
Would you want
>
sin a * b * c
>
to be
>
sin (a) * b *c
Yup.
It seems that a useful behavior to have would be for the
range of the unary operator to stop when we encounter
another such unary operator; i.e.
>
sin a + b + c + sin d + e + f
^ ^
Well, now you're falling into the world of heuristics to try and handle
the inconsistent mix of rules used by various authors.
You're obviously free to go there, but don't count me in.
Stefan