Procedure bodies have an implicit begin
. Thus
(lambda ()
(foo)
(bar))
is treated as if the same as
(lambda ()
(begin
(foo)
(bar)))
See Sequencing in the Racket guide for more details.
题
The Racket Docs state that the lambda
function can be invoked with multiple arguments after the body
argument, e.g.:
((lambda () (display "foo") (display "bar")))
prints foobar
.
How exactly does this work? I didn't find any explanation in the racket documentation. Did I miss something?
解决方案
Procedure bodies have an implicit begin
. Thus
(lambda ()
(foo)
(bar))
is treated as if the same as
(lambda ()
(begin
(foo)
(bar)))
See Sequencing in the Racket guide for more details.