lisp - explanation of lambda expression in scheme -
i wondering if explain lambda expression , how output derived. put interpreter , getting ((2) 2). i'm not sure why it's giving me instead of (2 2).
((lambda x (cons x x)) 2)
the expression (lambda x (cons x x)) produces function; function puts arguments list x; function returns (cons x x).
your expression calls above function argument of 2. in function x (2) (a list of arguments). function (cons '(2) '(2)) returns ((2) 2)
Comments
Post a Comment