#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 by , 5 years ago
comment:2 by , 5 years ago
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 by , 5 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:4 by , 5 years ago
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
comment:5 by , 5 years ago
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 by , 5 years ago
| Resolution: | → invalid |
|---|---|
| Status: | reopened → closed |
Went back over and removed some unnecessary injects from my code!
comment:7 by , 5 years ago
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