Welcome to the CHICKEN Scheme pasting service

profile entry/exit added by evhan on Mon Jul 24 03:44:45 2017

;;; profile-hack.scm

(declare (unit profile-hack))                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                 
(set! ##sys#profile-entry                                                                                                                                                                                                                                                        
  (let ((pe ##sys#profile-entry))                                                                                                                                                                                                                                                
    (lambda (i v)                                                                                                                                                                                                                                                                
      (print (list i v))                                                                                                                                                                                                                                                         
      (pe i v))))                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                 
(set! ##sys#profile-exit                                                                                                                                                                                                                                                         
  (let ((pe ##sys#profile-exit))                                                                                                                                                                                                                                                 
    (lambda (i v)                                                                                                                                                                                                                                                                
      (print (list i v))                                                                                                                                                                                                                                                         
      (pe i v))))

;;; program.scm

(declare (uses profile-hack))

(define (foo) (print 1))

(foo)


;;; compile as:
;
; csc -c profile-hack.scm
; csc program.scm profile-hack.o -profile
; ./program

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
       _  _       
  ___ (_)(_) __ _ 
 / __|| || |/ _` |
| (__ | || | (_| |
 \___|/ |/ |\__, |
    |__/__/    |_|
Visually impaired? Let me spell it for you (wav file) download WAV