Is it possible to implement the R5RS scheme function “length” using the car and cdr family of functions?
If so could someone post the implementation?
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.
Of course, it’s pretty simple. I’m not giving a straight answer because this looks like homework and anyway it’s trivial to write. Fill-in the blanks:
Notice that only
cdris used. We’re not interested in the actual contents of the list, so we can ignorecar.