With closure
(apply str [\a \b])
and
(apply str '(\a \b))
returns “ab”.
(apply str (\a \b))
returns an error.
Why is that?
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.
Because
(\a \b)means “call the function\awith an argument of\b“, and since the character\ais not a function, it fails. Note the difference in the following:As a general rule, if you want to write a literal sequence, use a vector instead of a quoted list since the quote will also stop evaluation of the parts inside the list, e.g.: