In Scheme, using syntax-rules():
(define-syntax function
(syntax-rules ()
((function name (args ...) body ...)
(define (name args ...) body ...))))
The error you are seeing is that apparently Chicken Scheme's compiler expects the second form of define-syntax
to be a macro expansion procedure - they typically require arguments for renaming and comparing identifiers. The lambda
in your macro doesn't produce a suitable function - syntax-rules
does.
The above is guaranteed hygienic.