Created
          October 3, 2010 14:20 
        
      - 
      
- 
        Save youz/608606 to your computer and use it in GitHub Desktop. 
    Gauche's debug-print macro for CL
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ;;; ref. http://practical-scheme.net/gauche/man/gauche-refj_16.html#SEC18 | |
| (defmacro debug-print (form) | |
| `(progn | |
| (format t "#?=~S~%" ',form) | |
| (let ((#1=#:values (multiple-value-list ,form))) | |
| (format t "#?- ~{~S~%~^#?+ ~}" #1#) | |
| (values-list #1#)))) | |
| (set-dispatch-macro-character #\# #\? | |
| #'(lambda (s c n) | |
| (declare (ignore c n)) | |
| (read-char s t) | |
| `(debug-print ,(read s t nil t)))) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment