From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Adding Identities to Peval Date: Wed, 15 Feb 2012 21:32:53 -0500 Message-ID: <87ipj733u2.fsf@netris.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329359675 9831 80.91.229.3 (16 Feb 2012 02:34:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2012 02:34:35 +0000 (UTC) Cc: guile-devel To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Feb 16 03:34:33 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RxrB2-0001Ma-O1 for guile-devel@m.gmane.org; Thu, 16 Feb 2012 03:34:32 +0100 Original-Received: from localhost ([::1]:53639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxrB1-00043d-UQ for guile-devel@m.gmane.org; Wed, 15 Feb 2012 21:34:31 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxrAz-00043N-D1 for guile-devel@gnu.org; Wed, 15 Feb 2012 21:34:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxrAy-00012d-Fq for guile-devel@gnu.org; Wed, 15 Feb 2012 21:34:29 -0500 Original-Received: from world.peace.net ([96.39.62.75]:59894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxrAy-00012Y-Be for guile-devel@gnu.org; Wed, 15 Feb 2012 21:34:28 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1RxrAr-0006ey-FJ; Wed, 15 Feb 2012 21:34:21 -0500 In-Reply-To: (Noah Lavine's message of "Wed, 15 Feb 2012 20:29:00 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13865 Archived-At: Hi Noah, Noah Lavine writes: > I've been working on a patch to add a new sort of optimization to > peval, and I think it's almost ready. It's based on some of the ideas > in "Environment Analysis of Higher-Order Languages". Nice! :) > There's one glaring wart. The identity checking is activiated by calls > to (toplevel 'eq?). Clearly, it should be activated by calls to the > primitive 'eq? (and eqv? and equal?). The reason it's not is that my > example above compiles to (call (toplevel-ref 'eq?) ...), and I don't > know how to make it turn into a (primcall 'eq? ...). The conversion from (toplevel-ref 'eq?) to (primcall 'eq?) is done by 'resolve-primitives!' in (language tree-il primitives). 'expand-primitives!' is normally also called before 'peval'. See 'optimize!' in (language tree-il optimize) for details. I hope to take a deeper look at your patch later, but for now I wanted to quickly answer your question :) Thanks! Mark