From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [IPv6:2a01:e0c:1:1599::15]) by sourceware.org (Postfix) with ESMTPS id 9CC563858408 for ; Sun, 26 Sep 2021 13:25:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CC563858408 Received: from smtpclient.apple (unknown [78.196.108.109]) (Authenticated sender: phiroc@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 6848978036C for ; Sun, 26 Sep 2021 15:25:14 +0200 (CEST) From: Philippe de Rochambeau Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: values Date: Sun, 26 Sep 2021 15:25:14 +0200 References: <9C7CF706-65C5-40E5-8949-EB836F398DDD@free.fr> To: kawa mailing list In-Reply-To: Message-Id: <52C1790E-E668-4FA0-B0B0-F27AB68D6B14@free.fr> X-Mailer: Apple Mail (2.3654.80.0.2.43) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Sep 2021 13:25:19 -0000 Hi Arvydas, thanks you for your feedback. I=E2=80=99ve managed to retrieve the 19 from div-and-mod using = let-values. Now, how do I add a procedure called =C2=AB (halve n) =C2=BB which when = passed a value such as 39, returns 19? Many thanks. Philippe (display (let-values (((a b) (div-and-mod 39 2))) a)) > Le 26 sept. 2021 =C3=A0 14:33, Arvydas Silanskas = a =C3=A9crit : >=20 > Hi >=20 > generally you would use constructs like define-values or let-values to = declare multiple variables which will be bound to the received multiple = values. There is also a more primitive call-with-values construct for = piping those values as arguments to some procedure. To get a list, you = could use `(call-with-values (lambda () (values 1 3)) list)`. >=20 > Arvydas >=20 > 2021-09-26, sk, 14:57 Philippe de Rochambeau via Kawa = > ra=C5=A1=C4=97: > Hello, > how do you retrieve the first item returned by the values procedure? > I=E2=80=99ve tried (first (values 1 3)), but to no avail, because = values doesn=E2=80=99t return a list. > Many thanks. > Philippe