fork download
  1. ;;;;
  2. ;;;; First approach
  3. ;;;;
  4.  
  5. (shadowing-import(defmacro :dotimes (&rest r) '(loop)))
  6. (print (macroexpand '(dotimes(i 8))))
  7.  
  8. ;; Revert import
  9. (shadowing-import 'cl:dotimes)
  10.  
  11. ;;;;
  12. ;;;; Second approach
  13. ;;;;
  14.  
  15. (set-macro-character #\8 (lambda (&rest r) '(loop)))
  16. (print '(dotimes (i 8)))
  17.  
  18. ;; Revert readtable modification (setting to NIL gives an error)
  19. (set-macro-character #\8 (lambda (stream char) (read stream T NIL T)) t)
Success #stdin #stdout 0s 535040KB
stdin
Standard input is empty
stdout
(BLOCK NIL (TAGBODY #:LOOP-3210 (GO #:LOOP-3210))) 
(DOTIMES (I (LOOP)))