Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

car and cdr have different behavior when called on empty list #27

Open
0xekez opened this issue Jun 7, 2021 · 0 comments
Open

car and cdr have different behavior when called on empty list #27

0xekez opened this issue Jun 7, 2021 · 0 comments
Labels
Interpreter 🐞 Related to the interpreter

Comments

@0xekez
Copy link
Owner

0xekez commented Jun 7, 2021

In the interpreter (car ()) and (cdr ()) yield () whereas in the compiler both calls result in a type error.

Currently, my preference is for the compilers behavior. It seems like if you ask for the second item of an empty list that is indeed an error. Right now it can be a little confusing but once we get around to improving the compiler's error messages I suspect we can make that error more obvious.

@0xekez 0xekez added the Interpreter 🐞 Related to the interpreter label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interpreter 🐞 Related to the interpreter
Projects
None yet
Development

No branches or pull requests

1 participant