#1760 closed defect (invalid)
IR-transformer not implicitly renaming?
Reported by: | Idiomdrottning | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | someday |
Component: | unknown | Version: | 5.2.0 |
Keywords: | Cc: | ||
Estimated difficulty: |
Description
Is this by design or borked?
(define-syntax a-test
(ir-macro-transformer
(lambda (e i c)
'(define hey '(print "I said hey!")))))
(a-test)
hey
Prints "I said hey!"
Change History (7)
comment:1 Changed 3 years ago by
comment:2 Changed 3 years ago by
Oh, ok, I see. It only renames them inside of the macro.
(define-syntax maif
(ir-macro-transformer
(lambda (e i c)
`(let ((it ,(cadr e)))
(if it ,(caddr e) ,(cadddr e))))))
(maif (zero? 0) it 'no)
comment:3 Changed 3 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:4 Changed 3 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:5 Changed 3 years ago by
OK I guess this is just normal.
(define-syntax stest
(syntax-rules ()
((stest)
(define (heyo) (print "Heyo!")))))
(stest)
(heyo)
So weird!
I thought this was "unhygienic"
comment:6 Changed 3 years ago by
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Went back over and removed some unnecessary injects from my code!
comment:7 Changed 3 years ago by
This is actually a corner case of ER macros, too. It's unspecified what should happen if you rename an identifier at toplevel. Currently, CHICKEN just strips the renaming, but this may change in the future, so it's better to leave those "unnecessary" injects, IMO.
I was thinking it was gonna say
Error: unbound variable: hey