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: Thu, 5 Apr 2018 10:16:59 +0200 Message-ID: <531867ae-fc67-35dc-e480-968678eed296@disroot.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1522916130 23121 195.159.176.226 (5 Apr 2018 08:15:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Apr 2018 08:15:30 +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 Thu Apr 05 10:15:26 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 1f403H-0005t0-Cx for guile-user@m.gmane.org; Thu, 05 Apr 2018 10:15:25 +0200 Original-Received: from localhost ([::1]:38610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f405M-0004jx-P3 for guile-user@m.gmane.org; Thu, 05 Apr 2018 04:17:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f404n-0004ix-Rb for guile-user@gnu.org; Thu, 05 Apr 2018 04:17:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f404i-0001ju-TH for guile-user@gnu.org; Thu, 05 Apr 2018 04:16:57 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:46564) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f404i-0001fV-Ed for guile-user@gnu.org; Thu, 05 Apr 2018 04:16:52 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id D82F42229E for ; Thu, 5 Apr 2018 10:16:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1522916209; bh=0T6VY5MNpUVf/0ycFPEbQlSi1SJplE0Bi7AYW8bysow=; h=To:From:Subject:Date; b=nT3QxTPtFYD9ilVVV2m+tpLMR3OK9toSN3NKVRlatE5bNquez1VTixcVfYNY97Y4m n8Tce4LpWtaqmFGgkzjZFASBsZZpDIJMWrdJC8n5hxArUFB4BOhlA2KQsN2ePRObd4 bsWwu9hzOQnq0IWDTRYL/xFFtQv7nFRKIfD8xop9BqaK85GIT/3+P/UjUFKj68slEo CfoZaTlBdU12iJhZ+pxAJ8AfxFEOIZ4k/ZHbycDYbvnTZNeT2D48HYLFJvlsjF6vwm eM2II/TV0jL/FETLw8exKVwtl2Nkk7u84eISVJ5fZhYa0JNTbGNTpHE+NTWmec4rek 4b0HyVRaVYxsA== 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 K0DM3xYdLx-o for ; Thu, 5 Apr 2018 10:16:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1522916208; bh=0T6VY5MNpUVf/0ycFPEbQlSi1SJplE0Bi7AYW8bysow=; h=To:From:Subject:Date; b=tV5xTn0q6PpoacWDef6Y4cikOmWOM+m39CLW0S9ZEOHO/tnVvkT8ct0EoQH4E4rr3 dBzpR5bRBoaBtmArYlXUScUGaeWBknZda5rhHlbXBaHOrfDmNM3Ex3HN6Hl41ooGJe 8F/NUXDg0hO2L215N5PU+G4XxFefwFGnF14ofMdgCZZdIgjr5W63fHc12w35L32EsH Nl/eNU9otSk+vxn/YNVjzlR346i7AbuGJh4NpqHaU3Vjom+2JBnYBAN1ZjAbJ4DlAI ndtkgTJeRVeG0eyOVZotqpPPZWlwqZ5eM0oIZ6cpQ3REPvWjnVR1GChF6xW9XbaKEk wlSv2YlG+NulA== 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-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:14528 Archived-At: > I think you'll find it easier to reason first about an f > which takes as many args as your conditionals produce, so > you won't be struggling to splice your "bunch of values" > into a bigger argument list. yes, thank you tomas, i stopped trying to return multiples values, and instead call the functions with the right numbers of args, and using the cond statement to change the values of args. (define (f a b c d) (+ a b c d)) (let ((a 1) (b #f) (c #f) (d 10)) (cond (#t (set! b 2) (set! c 3)) (else (set! b 6) (set! c 10))) (f a b c d))