public inbox for
 help / color / mirror / Atom feed
From: Philippe de Rochambeau <>
To: kawa mailing list <>
Subject: Re: values
Date: Sun, 26 Sep 2021 15:25:14 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Arvydas,
thanks you for your feedback.
I’ve managed to retrieve the 19 from div-and-mod using let-values.
Now, how do I add a procedure called « (halve n) » which when passed a value such as 39, returns 19?
Many thanks.

(display (let-values (((a b) (div-and-mod 39 2)))

> Le 26 sept. 2021 à 14:33, Arvydas Silanskas <> a écrit :
> Hi
> 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)`.
> Arvydas
> 2021-09-26, sk, 14:57 Philippe de Rochambeau via Kawa < <>> rašė:
> Hello,
> how do you retrieve the first item returned by the values procedure?
> I’ve tried (first (values 1 3)), but to no avail, because values doesn’t return a list.
> Many thanks.
> Philippe

  reply	other threads:[~2021-09-26 13:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 11:56 values Philippe de Rochambeau
2021-09-26 12:33 ` values Arvydas Silanskas
2021-09-26 13:25   ` Philippe de Rochambeau [this message]
2021-09-26 13:37     ` values Philippe de Rochambeau
2021-09-26 16:19       ` values Philippe de Rochambeau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).