From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: Multiple values passed as single argument to procedure Date: Mon, 12 Jun 2017 10:48:05 +0100 Message-ID: <73bb2ebb-e0b6-d6b8-b905-9c581090bd49@ossau.homelinux.net> References: <87mv9fnejc.fsf@gmail.com> <87k24i2rev.fsf@netris.org> <87zidexdjw.fsf@gmail.com> <87a85d3k9n.fsf@netris.org> <87mv9dy5wb.fsf@gmail.com> <9b96b4b9-2641-aee0-e6a2-10a3e82d6f3b@ossau.homelinux.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1497260919 31369 195.159.176.226 (12 Jun 2017 09:48:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Jun 2017 09:48:39 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 12 11:48:36 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKLxa-0007i3-RI for guile-user@m.gmane.org; Mon, 12 Jun 2017 11:48:35 +0200 Original-Received: from localhost ([::1]:37005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKLxc-0001Si-Vu for guile-user@m.gmane.org; Mon, 12 Jun 2017 05:48:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKLxG-0001Sa-JG for guile-user@gnu.org; Mon, 12 Jun 2017 05:48:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKLxC-0008L2-Mc for guile-user@gnu.org; Mon, 12 Jun 2017 05:48:14 -0400 Original-Received: from smtp-out-1.talktalk.net ([62.24.135.65]:23727) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dKLxC-0008Kw-FJ for guile-user@gnu.org; Mon, 12 Jun 2017 05:48:10 -0400 Original-Received: from arudy.520b.com ([2.96.192.194]) by smtp.talktalk.net with SMTP id KLx9dr3Pd9tMzKLx9dhvmA; Mon, 12 Jun 2017 10:48:08 +0100 X-Originating-IP: [2.96.192.194] X-Spam: 0 X-OAuthority: v=2.2 cv=WOE9ZTkR c=1 sm=1 tr=0 a=L9r2or1llNJpkmWEAwxYbQ==:117 a=L9r2or1llNJpkmWEAwxYbQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=LWSFodeU3zMA:10 a=rvWGZorHbtnWWD_g7rMA:9 a=QEXdDO2ut3YA:10 Original-Received: from [10.37.6.202] (unknown [213.86.221.35]) by arudy.520b.com (Postfix) with ESMTPSA id AF0CE38094 for ; Mon, 12 Jun 2017 10:39:07 +0100 (BST) In-Reply-To: <9b96b4b9-2641-aee0-e6a2-10a3e82d6f3b@ossau.homelinux.net> Content-Language: en-US X-CMAE-Envelope: MS4wfHOdd0qKvQzAv8jJf53Dvsj+6ryclhMx6bCT9HcyjGki0PuXOmyEHmIJJps3WOPgGVBbSSmvZ4C5YK/krzDjXOddw9KCWV3zimwliziyHC5PmY1Hn/vc ZGxnnK9pqk/xrRrLPvDEnhiKiGVVyTqYL9zqudGIZJ4BPLwnj7bpSbgr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 62.24.135.65 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13826 Archived-At: On 12/06/17 09:55, Neil Jerram wrote: > On 12/06/17 09:19, Chris Marusich wrote: >> I think I'm missing something here. In (list (f)), the call to f >> certainly looks like it's happening at a position that one might >> intuitively call a "tail" position. So, in this case, what disqualifies >> f from being in tail position? Can you give me an example of a call to >> f that would be in tail position, so I can understand the difference? >> Sorry if you've already provided such an example; I appreciate your >> explanations, and I'm just trying to make sure I fully understand. > > Mark will probably have a more precise answer for you, but let me > offer my understanding too. In general, in > > ( ... arbitrary code around ... > (f) > ... ) > > the (f) call is in a tail position if _nothing_ else needs to be done, > to the return value(s) of (f), before returning from that block as a > whole. > > So, common examples of tail position are > > (begin > ... > (f)) > > and > > (if > (f)) > > The case you mentioned, (list (f)), is probably the simplest example > of a non-tail position, because something very clearly does need to be > done to the return value of (f): it needs to be inserted into a newly > allocated list. > > Regards - Neil > > Oh, following David's reply, I see that my reply here may have missed your point - sorry if so! (Yes, it is undeniable that '(f)' is in tail position in the expression '(f)' :-). ) Neil