[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function argument order of evaluation
From: |
Tadeus Prastowo |
Subject: |
Re: Function argument order of evaluation |
Date: |
Mon, 11 Feb 2019 16:17:28 +0100 |
On Mon, Feb 11, 2019 at 4:03 PM <tomas@tuxteam.de> wrote:
>
> On Mon, Feb 11, 2019 at 10:53:06AM +0100, Tadeus Prastowo wrote:
> > Hello,
>
> [about C's funcall arguments evaluation order]
>
> > Does Emacs Lisp behave the same or does it provide a guarantee that
> > the function arguments are always evaluated from left to right?
>
> It's left-to-right. From the Elisp manual, "10.2.5 Evaluation of Function
> Forms":
>
> "If the first element of a list being evaluated is a Lisp function
> object, byte-code object or primitive function object [...] The
> first step in evaluating a function call is to evaluate the remaining
> elements of the list from left to right."
Yes, this is the answer. I really have missed the obvious statement
there. Thank you very much for your help.
> This seems to be consensus in most of the (traditional) Lisps. Scheme
> departed from that, specifying unspecified evaluation order, which
> created some stir at the time in comp.lang.scheme. There were (are?)
> Schemes which evaluate the arguments left-to-right.
Interesting. Once again, thank you.
> Cheers
> -- tomás
--
Best regards,
Tadeus