What ‘kind of thing’ will I get if I do this?
(car (list lambda lambda))
I thought I’d get lambda back, which means I could do
(define my_lambda (car (list lambda lambda)))
(define foo (my_lambda (n) (+ n n)))
But that didn’t work!
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
lambdais a special form (meaning: standard evaluation rules don’t apply to it), part of the core primitives of the language and is not a symbol or other kind of value that can be assigned to a variable.Answering your question, the “kind of thing” that you’ll get after evaluating the expression
(list lambda)will depend on the Scheme interpreter that you’re using, but more often than not you’ll get an error. For instance, DrRacket complains like this: