[plt-scheme] Macro stepper gone wild

From: Majorinc, Kazimir (kazimir at chem.pmf.hr)
Date: Wed Oct 10 18:06:21 EDT 2007

This macro works fine but Macro stepper (371) behaves wildly and
reports some internal errors.

(define-macro (!!! . args0)
(cons 'begin
(map (λ(p)
`(define-macro
,(cons (string->symbol
(string-append (symbol->string p) "!"))
'args)
`(begin (set! ,(car args) ,
(append (list (quote ,p)) args))
,(car args))))
args0)))

(!!! or and + - sin max min string-append cons)

(define x 3)
(+! x 1)
(max! x 2)
(max! x 5)
-------
output (as it should be):
4
4
5
-------
(!!! + - ...) defines macros +!, -! ... such that
(+! x expr) expands in (set! x (+ x expr)) ...

What's going on? Is it my or PLT bug? I think it is at least partly
PLT because whatever is wrong, it shouldn't be internal error.

Thank you,
Kazimir Majorinc


Posted on the users mailing list.