Reputation: 39
I want to ask,if one asks what is the type of lambda expression for this lambda expression,what will be the answer? Is it something like the type of result after completing that lambda expression?
For example : what is the type of lambda expression for this expression
(lambda (s) (string-append s s))
Thanks!
Upvotes: 1
Views: 81
Reputation: 24
Scheme is dynamically typed, this object will satisfy the PROCEDURE? predicate but other than that it does not have a type.
Upvotes: 0
Reputation: 66451
It is a function with one parameter, so it has the type a -> b
for some a
and b
.
Since it passes s
to string-append
, s
must be a string.
The result of string-append
is also a string, so the type is string -> string
.
Upvotes: 2