Skip to content

Commit

Permalink
trying to make return traces more useful for clos
Browse files Browse the repository at this point in the history
  • Loading branch information
netguy204 committed May 21, 2011
1 parent c4ea099 commit 91e0e1b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions conditions.sch
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,16 @@
(let ((proc->sym (make-hashtab-eq 100))
(returns (return-procedures)))
(dolist (proc-sym (filter sym-is-proc? (all-symbols)))
(hashtab-set! proc->sym (global-ref proc-sym) proc-sym))

(reverse (map (lambda (proc)
(hashtab-ref proc->sym proc proc))
returns))))
(hashtab-set! proc->sym (global-ref proc-sym) proc-sym)
(when (instance-of? <generic> (global-ref proc-sym))
;; insert all of its methods under the same name
(dolist (method (generic-methods (global-ref proc-sym)))
(hashtab-set! proc->sym (slot-ref method 'procedure) proc-sym))))

(cdddr (remove-sequential
(reverse (map (lambda (proc)
(hashtab-ref proc->sym proc proc))
returns))))))

(define (print-return-trace)
(dolist-idx ((frame idx) (return-trace))
Expand Down

0 comments on commit 91e0e1b

Please sign in to comment.