I recently started using ChickenScheme and now I want to declare a function with default argument (if not specified). I found this example on the Racket site, I know Racket and ChickenScheme are different but I thought that these basic things were the same.
(define greet
(lambda (given [surname "Smith"])
(string-append "Hello, " given " " surname)))
This is the error from the ChickenScheme interpreter:
Error: during expansion of (lambda ...) - in `lambda' - lambda-list expected: (lambda (given (surname "Smith")) (string-append "Hello, " given " " surname))
Call history:
<syntax> (define greet (lambda (given (surname "Smith")) (string-append "Hello, " given " " surname)))
<syntax> (##core#set! greet (lambda (given (surname "Smith")) (string-append "Hello, " given " " surname)))
<syntax> (lambda (given (surname "Smith")) (string-append "Hello, " given " " surname)) <--