hi, i wanted to create a macro that is used like a function definition and allow return using call/cc:
(define-syntax def (syntax-rules (return) ((_ (name args ...) body body* ...) (define name (lambda (args ...) (call/cc (lambda (return) body body* ...))))) ((_ name expr) (define name expr)))) unfortunaly i got error: scheme@(guile-user)> (def (test x) (cond ((= x 3) 7) ((= x 2) (return 5)) (else 3))) ;;; <stdin>:2:42: warning: possibly unbound variable `return' scheme@(guile-user)> (test 2) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Unbound variable: return any idea? Damien
