From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: User-reserved element in byte code vectors Date: 14 May 2004 14:27:23 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <85smepfzqo.fsf@junk.nocrew.org> <85ad0wfkms.fsf_-_@junk.nocrew.org> <85oepcdts4.fsf_-_@junk.nocrew.org> <85vfjf9s4j.fsf@junk.nocrew.org> <20040502094316.GB2836@fencepost> <85fzaiakb9.fsf@junk.nocrew.org> <20040503195701.GD21891@fencepost> <85ekpz5twj.fsf@junk.nocrew.org> <874qqiao9o.fsf@tc-1-100.kawasaki.gol.ne.jp> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084559790 9277 80.91.224.253 (14 May 2004 18:36:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 May 2004 18:36:30 +0000 (UTC) Cc: lars@nocrew.org, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 14 20:36:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOhXb-0004Jj-00 for ; Fri, 14 May 2004 20:36:15 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOhXb-0005Op-00 for ; Fri, 14 May 2004 20:36:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOhRW-0003Tu-AD for emacs-devel@quimby.gnus.org; Fri, 14 May 2004 14:29:58 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BOhPm-0001XD-2L for emacs-devel@gnu.org; Fri, 14 May 2004 14:28:10 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BOhP4-0000oF-3f for emacs-devel@gnu.org; Fri, 14 May 2004 14:27:58 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOhP3-0000nQ-Ot; Fri, 14 May 2004 14:27:25 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id ECCAA20A2C; Fri, 14 May 2004 14:27:23 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 8AB688CA23; Fri, 14 May 2004 14:27:23 -0400 (EDT) Original-To: Miles Bader In-Reply-To: <874qqiao9o.fsf@tc-1-100.kawasaki.gol.ne.jp> Original-Lines: 34 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-0.908, requis 5, BAYES_10 -0.91) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23413 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23413 > This is a patch that adds `curried functions' as discussed, using the > #[...] syntax. > (curry 'concat "The ") > => #[curry concat "The "] > (mapcar (curry 'concat "The ") '("a" "b" "c")) > => ("The a" "The b" "The c") > Does this look useful for your purposes Lars? Just some nitpicking: `curry' is the action of taking a function of 2 arguments and turning it into a function of one arg that returns another function that expects the second arg. I.e. (in pseudo Lisp): (curry 'concat) => (lambda (x) (lambda (y) (concat x y))) (funcall (curry 'concat) "The ") => (lambda (y) (concat "The " y)) (mapcar (funcall (curry 'concat) "The ") '("a" "b" "c")) => ("The a" "The b" "The c") I do not mean to say that you should change your `curry' to behave differently, but just that the name `curry' is not quite correct for your use (although your operation is definitely related to currying). What your `curry' does is a combination of curry and function application, which results in a partial function application. Maybe we should call it `partial-funcall'? Stefan "not good with names"