Hacker News new | ask | show | jobs
by Oreb 2234 days ago
I think you got this backwards. Common Lisp does have `first` and `rest` as synonyms for `car` and `cdr`. As far as I know, Scheme does not. I believe you have to use `car` and `cdr` there (unless, of course, you define your own synonyms).

I could be wrong about Scheme: My Scheme knowledge is badly outdated, and was always incomplete.

1 comments

Racket has `first` and `rest`. I just tried it. But I tried an online scheme interpreter and it did not have it.
first and rest are in racket, but racket has many things not in scheme (and doesn't have some things that are.) If you use the r5rs #lang (e.g. `racket -I r5rs`) you'll see that it doesn't have first and rest.

Also, first and rest in racket aren't synonyms for car and cdr. car and cdr take pairs, while first and last only take lists. Try this: (car '(1 . 2)) and (first '(1 . 2))