Deutsch English Français Italiano |
<jwvldsfrecv.fsf-monnier+comp.lang.lisp@gnu.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Stefan Monnier <monnier@iro.umontreal.ca> Newsgroups: comp.lang.lisp Subject: Re: infix via code walker hook. Date: Fri, 04 Apr 2025 14:17:20 -0400 Organization: A noiseless patient Spider Lines: 30 Message-ID: <jwvldsfrecv.fsf-monnier+comp.lang.lisp@gnu.org> References: <20250331141507.905@kylheku.com> <20250401201007.528@kylheku.com> <20250403192220.35@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 04 Apr 2025 20:17:20 +0200 (CEST) Injection-Info: dont-email.me; posting-host="c4785f6db9d201abe0a742add2baccc1"; logging-data="2797"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MmN2Lt5I/ASGPi6F4d9GUdtEx12h4nqs=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:UMKYDpFwD9lIfj9NgyY6GkeooWw= sha1:ZJ+OHhiw38UDV9p73FdEiDUHuFI= Bytes: 1740 > 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