4 ms·
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
by Oreb 6y 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.
- sigzero 6y agoRacket has `first` and `rest`. I just tried it. But I tried an online scheme interpreter and it did not have it.
- catalogia 6y agofirst 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))