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 09:55:55 +0100 Message-ID: <9b96b4b9-2641-aee0-e6a2-10a3e82d6f3b@ossau.homelinux.net> References: <87mv9fnejc.fsf@gmail.com> <87k24i2rev.fsf@netris.org> <87zidexdjw.fsf@gmail.com> <87a85d3k9n.fsf@netris.org> <87mv9dy5wb.fsf@gmail.com> 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 1497257784 402 195.159.176.226 (12 Jun 2017 08:56:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Jun 2017 08:56:24 +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 10:56:19 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 1dKL8z-000882-37 for guile-user@m.gmane.org; Mon, 12 Jun 2017 10:56:17 +0200 Original-Received: from localhost ([::1]:36851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKL94-0008T7-11 for guile-user@m.gmane.org; Mon, 12 Jun 2017 04:56:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKL8l-0008T0-28 for guile-user@gnu.org; Mon, 12 Jun 2017 04:56:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKL8i-0008I9-1Q for guile-user@gnu.org; Mon, 12 Jun 2017 04:56:03 -0400 Original-Received: from smtp-out-1.talktalk.net ([62.24.135.65]:24547) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dKL8h-0008HS-Q9 for guile-user@gnu.org; Mon, 12 Jun 2017 04:55:59 -0400 Original-Received: from arudy.520b.com ([2.96.192.194]) by smtp.talktalk.net with SMTP id KL8edqxxW9tMzKL8edht6b; Mon, 12 Jun 2017 09:55:56 +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=VKfnYOpVz_hk5L2gpkcA:9 a=QEXdDO2ut3YA:10 Original-Received: from [10.37.6.202] (unknown [213.86.221.35]) by arudy.520b.com (Postfix) with ESMTPSA id 8C19838094 for ; Mon, 12 Jun 2017 09:46:54 +0100 (BST) In-Reply-To: <87mv9dy5wb.fsf@gmail.com> Content-Language: en-US X-CMAE-Envelope: MS4wfM0WhW9vR5leQJ9ozt7sTepWUOpNgo/tLTC9fMdAVO/qvapbxHYfaK3VZrWg4+14Z+H9xHdUsWfJniDt6cfXNFzU1iHKW3HogTyHplfvyzr/Wc/y4J4o H1PXHUPQ9f2DVnZBzAJwlW7Dg0jvycdhHkX9yJmyZ0U08xALyK6R6tgj 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:13824 Archived-At: 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