[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function argument order of evaluation
From: |
tomas |
Subject: |
Re: Function argument order of evaluation |
Date: |
Mon, 11 Feb 2019 15:58:15 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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."
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.
Cheers
-- tomás
signature.asc
Description: Digital signature