2 minutes, 38 seconds
Expressions, Types, and Functions
- slide 39 : 46
Lambda expressions in Scheme
(lambda (formal-parameter-list) expression)
(lambda formal-parameters-name expression)
Lambda expression characteristics in Scheme:
No type declaration of formal parameter names
Call by value parameters
In reality passing of references to lists and other structures
Positional and required parameters
(lambda (x y z)
expr
)
accepts exactly three parameters
Required and rest parameters
(lambda (x y z . r)
expr
)
accepts three or more parameters
Rest parameters only
(lambda r
expr
)
accepts an arbitrary number of parameters
Parameter passing in Scheme