chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] lambda names in profile-output


From: Andre Kuehne
Subject: Re: [Chicken-users] lambda names in profile-output
Date: Sun, 22 Apr 2007 00:42:34 +0200
User-agent: Thunderbird 1.5.0.10 (X11/20070221)

Andre Kuehne wrote:
Andre Kuehne wrote:
I haven't figured out yet under what circumstances lambda-calls get profiled.
Sometimes i get lots of profile-entries like these:

...
g1710 10100 0.512 0.069 77.1084 g1708 101 0.512 0.005 77.1084 g1905 10000 0.336 0.36e 50.6024
...

However, some tests showed me, that not all lambdas get profiled. Can someone tell me, what the restrictions are?

I did some further tests and found that the inclusion of "(use syntax-case)"
makes the lambda-names disappear:

I digged some more and noticed that all syntax-extensions produce different lambda-names:

alexpander           _func_43
syntactic-closures   .func.2
syntax-case          g1531

Since the syntax-case-name looks like a plain gensym, it wasn't too difficult to
find the code where the name is generated. The attached patch to syntax-case makes the lambda-names similar to those produced by the syntactic-closures extension. This solves my problem at least, but i know next to nothing about the inner workings of chicken or syntax-case, so maybe this is not optimal.

Greetings
Andre Kuehne
Index: psyntax.scm
===================================================================
--- psyntax.scm (revision 3893)
+++ psyntax.scm (working copy)
@@ -626,7 +626,7 @@
 
 (define-syntax build-lexical-var
   (syntax-rules ()
-    ((_ src id) (##syncase#source-context src (gensym)))))
+    ((_ src id) (##syncase#source-context src (string->symbol (string-append 
"." (symbol->string id) "." (symbol->string (gensym ""))))))))
 
 (define-syntax self-evaluating?
   (syntax-rules ()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]