summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-11-15 23:38:40 +0100
committerAndy Wingo <wingo@pobox.com>2011-11-15 23:41:51 +0100
commitee15aa46e3fb29e609bd7c431e8f2676f6573d57 (patch)
tree57374d33ec538ece9ca8cb6227ecb17463538c81 /module
parentf3cf9421cb319e2cb9ffde4ec41cad7fdcafcebc (diff)
set names of functions defined at the toplevel from `eval'
* module/ice-9/eval.scm (primitive-eval): Set the name of toplevel-defined functions.
Diffstat (limited to 'module')
-rw-r--r--module/ice-9/eval.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/module/ice-9/eval.scm b/module/ice-9/eval.scm
index 62e36ed66..c0fa64c90 100644
--- a/module/ice-9/eval.scm
+++ b/module/ice-9/eval.scm
@@ -425,7 +425,10 @@
(memoize-variable-access! exp #f))))
(('define (name . x))
- (define! name (eval x env)))
+ (let ((x (eval x env)))
+ (if (and (procedure? x) (not (procedure-property x 'name)))
+ (set-procedure-property! x 'name name))
+ (define! name x)))
(('toplevel-set! (var-or-sym . x))
(variable-set!