From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.user Subject: Re: Multiple values passed as single argument to procedure Date: Sun, 11 Jun 2017 10:28:38 +0200 Organization: Organization?!? Message-ID: <87efur7wsp.fsf@fencepost.gnu.org> References: <87mv9fnejc.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497169757 7386 195.159.176.226 (11 Jun 2017 08:29:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Jun 2017 08:29:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 11 10:29:13 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 1dJyFF-0001j6-Ov for guile-user@m.gmane.org; Sun, 11 Jun 2017 10:29:13 +0200 Original-Received: from localhost ([::1]:33218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJyFL-00087j-18 for guile-user@m.gmane.org; Sun, 11 Jun 2017 04:29:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJyEw-00087S-It for guile-user@gnu.org; Sun, 11 Jun 2017 04:28:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJyEr-0003vT-Qd for guile-user@gnu.org; Sun, 11 Jun 2017 04:28:54 -0400 Original-Received: from [195.159.176.226] (port=54700 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJyEr-0003vE-Jf for guile-user@gnu.org; Sun, 11 Jun 2017 04:28:49 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dJyEj-0008VK-I1 for guile-user@gnu.org; Sun, 11 Jun 2017 10:28:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@blaine.gmane.org X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw Cancel-Lock: sha1:zTI81YMasTbq2FIAbhQnnlhY4aQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:13803 Archived-At: Chris Marusich writes: > I've noticed that when one passes multiple values as a single argument > to a procedure, only the first value gets used. Is this expected? Yes. > However, I did find the following information in R6RS (Section 5.8: > "Multiple return values"), which seems possibly relevant: > > "Not all continuations accept any number of values. For example, a > continuation that accepts the argument to a procedure call is guaranteed > to accept exactly one value. The effect of passing some other number of > values to such a continuation is unspecified." Guile resolves this unspecification by passing the first value. Here is a proposal that tries normalizing the special case of passing zero values as well: This "use only the first value in non-multiple-value accepting contexts" is similar to what Lua uses in the context of "..." argument lists. -- David Kastrup