I'm recently implementing a scheme interpreter using scheme itself. I know that single dot notation means constructing a pair or defining a lambda with multiple parameters. But then I discover that
'(3 . 4 . 5)
evaluates to
'(4 3 5)
and
(define (a . b . c) (displayln b) (displayln c))
(a 4 3)
it will print (weird that #\newline is not printed)
(4 3)>
Can somebody explain the meaning of double dot notation?
(define (a . b . c) ... )
should be evaluated as(define (b a c) ...)
. so(a 1 2)
should raise error "a: undefined". Are there any function which nameda
in your source code ?#!racket
specific it has nothing to do with scheme