From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tadeus Prastowo Newsgroups: gmane.emacs.help Subject: Re: Function argument order of evaluation Date: Mon, 11 Feb 2019 16:15:14 +0100 Message-ID: References: <87ftsuz87s.fsf@home.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="19264"; mail-complaints-to="usenet@blaine.gmane.org" Cc: help-gnu-emacs@gnu.org To: YUE Daian Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 11 16:15:58 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtDJI-0004cw-Gz for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Feb 2019 16:15:52 +0100 Original-Received: from localhost ([127.0.0.1]:51586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtDJH-0003Ci-Fw for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Feb 2019 10:15:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtDJ3-0003CX-Ug for help-gnu-emacs@gnu.org; Mon, 11 Feb 2019 10:15:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtDJ2-0004VT-6j for help-gnu-emacs@gnu.org; Mon, 11 Feb 2019 10:15:37 -0500 Original-Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]:42434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtDIy-0004MR-9Q for help-gnu-emacs@gnu.org; Mon, 11 Feb 2019 10:15:34 -0500 Original-Received: by mail-qk1-x72d.google.com with SMTP id y140so6587100qkb.9 for ; Mon, 11 Feb 2019 07:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unitn.it; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RO28hjN+jnF55az6KnVpipmcUhSBm8kUAlF0zgORuQU=; b=CF10vjmAPZtXxl3n4KsT1CbsqXUsOkz/VSw2cAdVYhUGMAcmbyStBOWw9fC1fsi/33 bBcdQfVTL+ABZomvztqF06jrcQrUERUZKdRG5D8BqG28T0Zpq1pFeWGYfBLMLqSZKdFJ LU4vKI7n4aQkvB4OeWMbKFN8j0sBivx9gEAmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RO28hjN+jnF55az6KnVpipmcUhSBm8kUAlF0zgORuQU=; b=TX4IC1WCeS1QCP5+sFXO57+byzkzn5zwfUkqxffc3S74rySdYVz1vfwOryEhCCgFKb 9k8fz+KnW5VwDRQ3rwWwmxJVP7JNktBbhuUGFGXOCHxWAFBj/jRPPXw+KM59P89YQz0j ksinMLi0osucjSQRQ+ngk9QUtIP0BfkcRcU4oWASNZtfQWGurmMbThsr1AKYlgW84Eig XdOPBbt4tSUYNXxaEhMeKnsPuUtf4PreR7Zp9U4A+ThUM2c8NJlbMMwx7DQlaS7rrB1s xB0RsV4F/Z29VWL7QN3sYnS4sKdX7td5jZG2t02C1eBbFxRTGfK4s46EC6jMZ+3OG14n M3uQ== X-Gm-Message-State: AHQUAuaeaHJxN/8we9QfZ4fbYPt+q2zzNvG+Yp7dgzAv72Jhc3ITDaYH LCJk/vlRsfDjhlH2rWegimpKQ2lQsW6DvA+5zv7c X-Google-Smtp-Source: AHgI3IbXDf6lzUSPk8PVkwqnHdPwDiYHxTWcGNqsSZczAiw0GAbAyJwNH1+CTx+jD1CmTEIfWIXdx4zp4XX9WJXw98M= X-Received: by 2002:a37:a20d:: with SMTP id l13mr19577280qke.253.1549898126041; Mon, 11 Feb 2019 07:15:26 -0800 (PST) In-Reply-To: <87ftsuz87s.fsf@home.i-did-not-set--mail-host-address--so-tickle-me> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119344 Archived-At: On Mon, Feb 11, 2019 at 4:01 PM YUE Daian wrote: > > On 2019-02-11 10:53, Tadeus Prastowo wrote: > > Hello, > > > > In C/C++, the following code has an undefined behavior (UB): > > > > int my_var = 1; > > my_function((my_var = 10), 2 * my_var); > > > > It is because their respective standards do not specify that the > > assignment `(my_var = 10)' as the first argument must be evaluated > > before the second argument `2 * my_var' is evaluated. So, > > `my_function' can see as its arguments either `10' and `20' or `10' > > and `2'. [...] > Hi Tadeus, Hi Danny, > From the Emacs Lisp reference: > ...then the forms in the function body are evaluated in order, and the > value of the last body form becomes the value of the function call. > > You see, the forms in the function body are evaluated *in order*. > > I think it can be treated as a guarantee? ;-) Thank you for responding. But, my question is not about the evaluation of the function body but about the invocation of the function itself. > Reference: > https://ftp.gnu.org/old-gnu/Manuals/elisp-manual-20-2.5/html_chapter/elisp_9.html#SEC114 > > Danny -- Best regards, Tadeus