From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: Does Guile have a curry form? Date: Thu, 02 Dec 2010 09:17:39 +0100 Message-ID: <874oaw4mho.fsf@ambire.localdomain> References: <20101202054556.1bc2523c@halmanfloyd> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291278623 14007 80.91.229.12 (2 Dec 2010 08:30:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Dec 2010 08:30:23 +0000 (UTC) Cc: guile-user@gnu.org To: Marek Kubica Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Dec 02 09:30:19 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PO4YU-0002sj-8B for guile-user@m.gmane.org; Thu, 02 Dec 2010 09:30:18 +0100 Original-Received: from localhost ([127.0.0.1]:45417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PO4YT-0006H0-BB for guile-user@m.gmane.org; Thu, 02 Dec 2010 03:30:17 -0500 Original-Received: from [140.186.70.92] (port=60297 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PO4W2-0004lm-VN for guile-user@gnu.org; Thu, 02 Dec 2010 03:27:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PO4Vp-0006bk-M0 for guile-user@gnu.org; Thu, 02 Dec 2010 03:27:46 -0500 Original-Received: from smtp206.alice.it ([82.57.200.102]:56262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PO4Vp-0006aD-DE for guile-user@gnu.org; Thu, 02 Dec 2010 03:27:33 -0500 Original-Received: from ambire.localdomain (95.244.66.230) by smtp206.alice.it (8.5.124.08) id 4C1A268C0B843609; Thu, 2 Dec 2010 09:22:25 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1PO4MF-0001eP-UB; Thu, 02 Dec 2010 09:17:39 +0100 In-Reply-To: <20101202054556.1bc2523c@halmanfloyd> (Marek Kubica's message of "Thu, 2 Dec 2010 05:45:56 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8274 Archived-At: () Marek Kubica () 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.