Welcome to the CHICKEN Scheme pasting service

ir-macros pasted by megane on Thu Jun 21 13:27:35 2012

(define-syntax foo
	  (ir-macro-transformer
	   (lambda (e i c)
	     (print "--") 
	     (print "e\t " e)
	     (print "(i e)\t "(i e))
	     `(begin))))
(begin-for-syntax (print "without module"))
(foo (bar foo baz a))
(foo (bar foo baz 'a))

(module irtest-foo
	*
	(import chicken scheme)
	(define-syntax foo
	  (ir-macro-transformer
	   (lambda (e i c)
	     (print "--") 
	     (print "e\t " e)
	     (print "(i e)\t "(i e))
	     `(begin)))))

(import irtest-foo)
(begin-for-syntax (print "with module"))
(foo (bar foo baz a))
(foo (bar foo baz 'a))

;; without module
;; --
;; e	 (foo28 (bar29 foo28 baz30 a31))
;; (i e)	 (foo (bar foo baz a)) 			<--- OK
;; --
;; e	 (foo33 (bar34 foo33 baz35 (quote36 a37)))
;; (i e)	 (foo (bar foo baz (quote a)))		<--- OK
;; with module
;; --
;; e	 (foo57 (bar58 foo57 baz59 a60))
;; (i e)	 (foo5761 (bar foo5761 baz a)) 		<--- ??????????
;; --
;; e	 (foo63 (bar64 foo63 baz65 (quote66 a67)))
;; (i e)	 (foo6368 (bar foo6368 baz (quote6669 a))) 	<--- ??????????

no title pasted by megane on Thu Jun 21 13:54:05 2012

(define-syntax foo
	  (ir-macro-transformer
	   (lambda (e i c)
	     (print "--") 
	     (print "e\t " e)
	     (print "(i e)\t "(i e))
	     `(begin))))
(begin-for-syntax (print "without module"))
(foo (bar foo baz a))
(foo (bar foo baz 'a))

(module irtest-foo
	(foo2)
	(import chicken scheme)
	(define-syntax foo2
	  (ir-macro-transformer
	   (lambda (e i c)
	     (print "--") 
	     (print "e\t " e)
	     (print "(i e)\t "(i e))
	     `(begin)))))

(import-for-syntax irtest-foo)
(begin-for-syntax (print "with module"))
(foo2 (bar foo baz a))
(foo2 (bar foo baz 'a))

;; without module
;; --
;; e	 (foo28 (bar29 foo28 baz30 a31))
;; (i e)	 (foo (bar foo baz a))
;; --
;; e	 (foo33 (bar34 foo33 baz35 (quote36 a37)))
;; (i e)	 (foo (bar foo baz (quote a)))
;; with module

;; Error: unbound variable: foo2

strip-syntax added by megane on Thu Jun 21 16:22:05 2012

(define-syntax foo
  (ir-macro-transformer
   (lambda (e i c)
     (print "--") 
     (print "e\t\t\t " e)
     (print "(i e)\t\t\t " (i e))
     (print "(strip-syntax e)\t " (strip-syntax e))
     `',(strip-syntax e))))

(define bar (foo (list 1 2 3)))
(print bar)

(module amod
	*
	(import chicken scheme)
	(define-syntax foo2
	  (ir-macro-transformer
	   (lambda (e i c)
	     (print "--") 
	     (print "e\t\t\t " e)
	     (print "(i e)\t\t\t " (i e))
	     (print "(strip-syntax e)\t " (strip-syntax e))
	     `',(strip-syntax e))))
	(define amod-foo (foo2 (list 1 2 3))))

(import amod)
(print amod-foo)

;; --
;; e (foo29 (list30 1 2 3))
;; (i e) (foo (list 1 2 3))
;; (strip-syntax e) (foo (list 1 2 3))
;; (foo (list 1 2 3))
;; --
;; e (foo246 (list47 1 2 3))
;; (i e) (foo2 (list4748 1 2 3))
;; (strip-syntax e) (foo2 (list 1 2 3))
;; (foo2 (#%list 1 2 3)) <- ???????????????

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Name of the most used CHICKEN HTTP server implementation:
Visually impaired? Let me spell it for you (wav file) download WAV