sorry if my question was unclear , i search the source code if it exist in scheme with macro (or not) but not in C for the 'case function (procedure or macro) , i want to modify the code to allow inner definitions the way i do it for example with 'do:
;; with a definition inside only the new version works:
;; (do ((i 1 (1+ i))
;; (p 3 (* 3 p)))
;; ((> i 4)
;; p)
;; (define x 7)
;; (set! p (+ p i x)))
;; $3 = 1257
(define-syntax do
(syntax-rules ()
((do ((var init step ...) ...)
(test expr ...)
command ...)
(letrec
((loop
(lambda (var ...)
(if test
;;(begin
(let ()
#f ; avoid empty begin
expr ...)
;;(begin
(let ()
command
...
(loop (do "step" var step ...)
...))))))
(loop init ...)))
((do "step" x)
x)
((do "step" x y)
y)))
regards,
Damien