From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: calcium Newsgroups: gmane.lisp.guile.user Subject: Re: help : call function with args Date: Wed, 4 Apr 2018 09:43:18 +0200 Message-ID: <3b59deec-179a-00d3-2957-9a460e3bbc2b@disroot.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1522850881 21826 195.159.176.226 (4 Apr 2018 14:08:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Apr 2018 14:08:01 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Apr 04 16:07:57 2018 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 1f3j4u-0005Yb-7U for guile-user@m.gmane.org; Wed, 04 Apr 2018 16:07:56 +0200 Original-Received: from localhost ([::1]:32920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3j6z-000796-ID for guile-user@m.gmane.org; Wed, 04 Apr 2018 10:10:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3d4e-0000wO-Rx for guile-user@gnu.org; Wed, 04 Apr 2018 03:43:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3d4Z-0002wC-Ve for guile-user@gnu.org; Wed, 04 Apr 2018 03:43:16 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:60324) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3d4Z-0002w2-Iw for guile-user@gnu.org; Wed, 04 Apr 2018 03:43:11 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 7C05A217BC for ; Wed, 4 Apr 2018 09:43:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1522827789; bh=BrHmZfyOvC7YU2WpbC6DVzzNBRXZjkQw+adz5RkoaOU=; h=From:To:Subject:Date; b=qUobhITgBbD4xuiQBxkW/uxWqQgMM5sYd1JZA+Sz6H09o8OIzbzixsrKzvA4gFNzM RSusRkfK3QBT5gHzbq4f2X4TfVZglZ/XekWCdioPX08JQ9MuRZrYiyn9Tyd+tvwEAo RHh45dx6lem/GcVlt32QRWznLznrKcy+Bs8k5Q1Lau3NArDgw2J1a6HWhLj/Wis2Bz 8YtqWmBMBxVbCQZxrNTgbhaep0BPCgfDSAXhZfouqUI+7BP/cbD2+55ORfl6fIo+zy GHfL7Jkdi25CXRnbYJEq3/mHtWUW/KbSUA3FZsPLsdt3zY/p8o1QymWHWddWmp9Vo9 GRZg/QsY1Ojvg== X-Virus-Scanned: Debian amavisd-new at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (mail01.disroot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wl8rI-uqfbDa for ; Wed, 4 Apr 2018 09:43:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1522827787; bh=BrHmZfyOvC7YU2WpbC6DVzzNBRXZjkQw+adz5RkoaOU=; h=From:To:Subject:Date; b=hsslrQLMTnBKgFPLNoJoyd8TPvaLYux0QCt5ZUj9K7val47fm7TEux/tkqO7zUOKc wn+l1QUlkRoafusuJLFX/y5v+Xgv4fT6lG7EcWSc2KinYbZSryUmjSGFw9px89QWjy C9u6/8W8U4b3NoJaoAnKv3QUjrUyjzZkOk2bL694eWqIvQZpPz8qZrzivfULNKB6uX 2lq61i5eDm7NFlEmLNkzXjTZo7zNUrSNzqfhQN86sGH9ZK/EZZLOIr1Wv+qpMuZXKo Usj4yovS1n1A+5JGEQnQ4mFRSEogh1AbIgmoz2V1/WYPbpatDzEWr3m0DCTQmfGnqZ Jbg/CnDTZKnyQ== Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.21.23.139 X-Mailman-Approved-At: Wed, 04 Apr 2018 10:09:24 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:14526 Archived-At: Sorry, I tried to use a disposable email web service, but it didn=E2=80=99= t work, so I just created a email account. The question was how to do what I intended with this code (sorry I don=E2= =80=99t know how to express this with words) : (define (f a b c d) (+ a b c d)) (f 1 (values 2 3) 4) ;;so that I can return multiples args inside a cond or an if statement calling a function like: (f 1 (if #t (values 2 3) (values 4 5)) 6) ;;and if this is not possible, which way would be the best to write this sort of things ?, would it be using internal define so that I only have to write the different values of the arguments inside the new shortened function?. And while I am asking, is there a way to use the default value of an optional key, but using the key : (define* (rice #:key (color 'white) (weight 10)) (list color weight)) (define* (lst-of-rice #:key (color 'white) (weight 10)) (list (rice #:color color #:weight weight) (rice #:color color #:weight weight))) ;;sot that instead of writing in lst-of-rice (color =E2=80=98white), writ= e (color UseSameAsKeyofRice), or something that use the default value of rice, if no value is given in lst-of-rice, and use the value of lst-of-rice when we use is key. Thanks, and sorry for the first email.