From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: User-reserved element in byte code vectors Date: Sat, 22 May 2004 05:37:15 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040522093715.GA18945@fencepost> References: <20040517220612.GA6421@fencepost> <20040519142851.GA17602@fencepost> <20040520003129.GA9853@fencepost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085283367 23679 80.91.224.253 (23 May 2004 03:36:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 May 2004 03:36:07 +0000 (UTC) Cc: lars@nocrew.org, emacs-devel@gnu.org, monnier@iro.umontreal.ca, Miles Bader Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 23 05:35:59 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 1BRjmJ-0006i0-00 for ; Sun, 23 May 2004 05:35:59 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BRjmJ-0002YM-00 for ; Sun, 23 May 2004 05:35:59 +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 1BRjTd-0001Tn-50 for emacs-devel@quimby.gnus.org; Sat, 22 May 2004 23:16:41 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BRjTW-0001TT-Jz for emacs-devel@gnu.org; Sat, 22 May 2004 23:16:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BRjT0-0001O3-BZ for emacs-devel@gnu.org; Sat, 22 May 2004 23:16:33 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BRizc-0004YM-NB for emacs-devel@gnu.org; Sat, 22 May 2004 22:45:40 -0400 Original-Received: from miles by fencepost.gnu.org with local (Exim 4.34) id 1BRSwN-0006N0-4a; Sat, 22 May 2004 05:37:15 -0400 Original-To: Richard Stallman Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i Blat: Foop 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:23832 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23832 On Sat, May 22, 2004 at 03:31:54AM -0400, Richard Stallman wrote: > > (let ((env (vector 0))) > > (curry env (lambda (env) (aset env 0 (+ (aref env 0) 1))))) > > Wouldn't it be better to add an env slot to byte-compiled functions? > No matter how the code implements that, it ought to be somewhat faster. a new closure/environment is created ever time you invoke the above code, but the actual code-object representing the lambda is a constant. This is why it's natural to use a representation where the closure actually points to the code-object, rather than the other way around. I don't there'd be much speed avantage to a call using the opposite method -- the overhead of using curry is basically an extra layer of Ffuncall before getting to Fbyte_code. [In the extremely unlikely case that it _was_ an issue, you could simply have funcall_funvec call Fbyte_code directly when appropriate.] BTW, while this is an interesting subject, what about the basic funvec/curry patch? -Miles -- (\(\ (^.^) (")") *This is the cute bunny virus, please copy this into your sig so it can spread.