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: 19 May 2004 11:19:15 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <874qqiao9o.fsf@tc-1-100.kawasaki.gol.ne.jp> <20040515231012.GA20052@fencepost> <20040517220612.GA6421@fencepost> <20040519142851.GA17602@fencepost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085013806 9242 80.91.224.253 (20 May 2004 00:43:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 May 2004 00:43:26 +0000 (UTC) Cc: lars@nocrew.org, Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 20 02:43:17 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 1BQbeX-0003W0-00 for ; Thu, 20 May 2004 02:43:17 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQbeX-0005fC-00 for ; Thu, 20 May 2004 02:43:17 +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 1BQbdd-0000TH-Nd for emacs-devel@quimby.gnus.org; Wed, 19 May 2004 20:42:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BQbJW-00028w-7t for emacs-devel@gnu.org; Wed, 19 May 2004 20:21:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BQbBK-0007wg-7T for emacs-devel@gnu.org; Wed, 19 May 2004 20:13:42 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BQaIo-0005lZ-Pm; Wed, 19 May 2004 19:16:46 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by mx20.gnu.org with esmtp (Exim 4.34) id 1BQTKR-00065q-1F; Wed, 19 May 2004 11:49:59 -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 1E51721121; Wed, 19 May 2004 11:19:21 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id DAC128CA23; Wed, 19 May 2004 11:19:18 -0400 (EDT) Original-To: Miles Bader In-Reply-To: <20040519142851.GA17602@fencepost> Original-Lines: 33 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=-4.9, requis 5, autolearn=not spam, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca 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:23750 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23750 > For what sort of closures? This currying implementation originated with > the closures in my lexical-binding implementation -- _after_ I had > implemented the mechanism for doing closures, I realized that it was > precisely the same as the currying operator, and so now I called it that, > as that's a more interesting operation in standard emacs. But it's the > same thing as closures for me (not just similar, the same). I'd be interested to see how you use those `curry' thingies, BTW. E.g. what does (let ((x 0)) (lambda () (setq x (+ x 1)))) get translated into? The reason I ask is because a common closure representation is almost the one you suggested except that instead of (funcall #[closure f a1 a2] a3 a4) => (f a1 a2 a3 a4) the reduction rule looks like: (funcall #[closure f a1 a2] a3 a4) => (f #[closure f a1 a2] a3 a4) so that the function `f' can modify the vector in order to perform a `setq' on the free variable. Of course, the above representation doesn't work as straightforwardly if the free variable is shared by more than one closure. Stefan