From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: szgyg Newsgroups: gmane.lisp.guile.user Subject: Re: values->list elements Date: Tue, 13 Jun 2006 19:20:47 +0200 Message-ID: <448EF3EF.7010006@freemail.hu> References: <448E12B1.8070709@fastmail.fm> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150219325 20831 80.91.229.2 (13 Jun 2006 17:22:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Jun 2006 17:22:05 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jun 13 19:22:01 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FqCaI-0004gY-So for guile-user@m.gmane.org; Tue, 13 Jun 2006 19:21:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqCaI-00023n-70 for guile-user@m.gmane.org; Tue, 13 Jun 2006 13:21:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FqCaD-00021r-E0 for guile-user@gnu.org; Tue, 13 Jun 2006 13:21:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FqCaA-0001y6-EY for guile-user@gnu.org; Tue, 13 Jun 2006 13:21:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqCaA-0001xx-BB for guile-user@gnu.org; Tue, 13 Jun 2006 13:21:38 -0400 Original-Received: from [157.181.151.9] (helo=mx2.mail.elte.hu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FqCj9-00080B-Mn for guile-user@gnu.org; Tue, 13 Jun 2006 13:30:55 -0400 Original-Received: from mailbox1.caesar.elte.hu ([157.181.151.157]) by mx2.mail.elte.hu with esmtp (Exim) id 1FqCa3-00035f-2J from for ; Tue, 13 Jun 2006 19:21:32 +0200 Original-Received: from [0.0.0.0] (login08.caesar.elte.hu [157.181.151.137]) by mailbox1.caesar.elte.hu (Postfix) with ESMTP id D2B534C015 for ; Tue, 13 Jun 2006 19:21:35 +0200 (CEST) User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: guile-user In-Reply-To: <448E12B1.8070709@fastmail.fm> X-ELTE-SpamScore: -3.3 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-3.3 required=5.9 tests=ALL_TRUSTED, BAYES_50 autolearn=no SpamAssassin version=3.0.3 -3.3 ALL_TRUSTED Did not pass through any untrusted hosts 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% [score: 0.5003] X-ELTE-VirusStatus: clean X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5355 Archived-At: Jon Wilson wrote: > Is there any sensible way to implement the following semantics: > > (+ (values 1 2)) > ==> > 3 > > Or perhaps with a macro of some sort (but preferably as above)... > > (+ (values->list-elements (values 1 2))) > ==> > 3 ! untested code ! (define-macro (values->list vs) `(call-with-values (lambda () ,vs) list)) (apply + (values->list (values 1 2 3))) or (define-macro (make-cockeyed-function f) `(lambda (vs) (apply ,f (values->list vs)))) ((make-cockeyed-function +) (values 1 2 3)) > The intermediate step (after the macro expansion I guess) would look like > > (+ 1 2) No, this is impossible without redefining +. A macro produces 1 sexp, not more. > It seems like this would make multiple values much much more useful. szgyg ps: GNU Free Software Directory list guile-1.6.7 as recent _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user