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.user Subject: Re: Guile 2.0 interpretation vs compilation Date: Mon, 06 Oct 2014 03:58:10 -0400 Message-ID: <878ukt4okt.fsf@yeeloong.lan> References: <87d2a693st.fsf@elektro.pacujo.net> <87d2a5esk0.fsf@netris.org> <87wq8d671o.fsf@elektro.pacujo.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412582346 10755 80.91.229.3 (6 Oct 2014 07:59:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Oct 2014 07:59:06 +0000 (UTC) Cc: guile-user@gnu.org To: Marko Rauhamaa Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Oct 06 09:58:59 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xb3C2-0002R3-Tp for guile-user@m.gmane.org; Mon, 06 Oct 2014 09:58:55 +0200 Original-Received: from localhost ([::1]:50613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb3C2-0000eb-Lj for guile-user@m.gmane.org; Mon, 06 Oct 2014 03:58:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb3Bp-0000eU-KF for guile-user@gnu.org; Mon, 06 Oct 2014 03:58:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xb3Bk-00039H-5q for guile-user@gnu.org; Mon, 06 Oct 2014 03:58:41 -0400 Original-Received: from world.peace.net ([96.39.62.75]:55951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb3Bk-000399-29 for guile-user@gnu.org; Mon, 06 Oct 2014 03:58:36 -0400 Original-Received: from c-24-62-95-23.hsd1.ma.comcast.net ([24.62.95.23] helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Xb3Bd-0002lY-8J; Mon, 06 Oct 2014 03:58:29 -0400 In-Reply-To: <87wq8d671o.fsf@elektro.pacujo.net> (Marko Rauhamaa's message of "Mon, 06 Oct 2014 09:33:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11569 Archived-At: Marko Rauhamaa writes: > Mark H Weaver : > >> This is expected but not ideal. Our primitive evaluator does not >> preserve non-toplevel variable names, and therefore the associated >> procedure names are lost. Maybe we can fix this in Guile 2.2. > > I noticed the issue because I have software that depends on the > procedure-name of inner functions. I can live with this guile-2.0 quirk > if it is considered a guile defect. Here's a simple workaround for now, though unfortunately it will mostly prevent our compiler from doing optimizations on code that uses this 'define' macro: (define-syntax define (syntax-rules () ((define (proc . args) body body* ...) (define proc (let ((p (lambda args body body* ...))) (set-procedure-property! p 'name 'proc) p))) ((define name expr) ((@ (guile) define) name expr)))) Does this work for you? Alternatively, you could make sure to always compile your code, in which case 'procedure-name' should work properly. Mark