From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: Marek Kubica <marek@xivilization.net>
Cc: guile-user@gnu.org
Subject: Re: Does Guile have a curry form?
Date: Thu, 02 Dec 2010 09:17:39 +0100 [thread overview]
Message-ID: <874oaw4mho.fsf@ambire.localdomain> (raw)
In-Reply-To: <20101202054556.1bc2523c@halmanfloyd> (Marek Kubica's message of "Thu, 2 Dec 2010 05:45:56 +0100")
() Marek Kubica <marek@xivilization.net>
() Thu, 2 Dec 2010 05:45:56 +0100
Before I reinvent the wheel, does Guile have support for
something similar to Racket's curry/curryr or Pythons
functools.partial, which returns me a lambda with some
arguments already pre-set?
If you mean:
(define ((foo x) y)
(+ x y))
===
(define (foo x)
(lambda (y)
(+ x y)))
with usage, e.g.:
(map (foo 1) (iota 3))
=> (1 2 3)
then, yes, prior to Guile 1.9, this was supported out of the box.
With 1.9 and later you must:
(use-modules (ice-9 curried-definitions))
first. I wonder if there is a way to autoload that module, to
achieve the pre-1.9 (out of the box) behavior.
next prev parent reply other threads:[~2010-12-02 8:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-02 4:45 Does Guile have a curry form? Marek Kubica
2010-12-02 8:17 ` Thien-Thi Nguyen [this message]
2010-12-02 14:11 ` Ludovic Courtès
2010-12-08 14:21 ` Marek Kubica
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874oaw4mho.fsf@ambire.localdomain \
--to=ttn@gnuvola.org \
--cc=guile-user@gnu.org \
--cc=marek@xivilization.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).