-
Notifications
You must be signed in to change notification settings - Fork 47
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
'PRINT
is a valid function name
#66
Comments
I don't think it's necessary (or useful) to fix it. I think it's a consequence of uLisp being a Lisp-1, and Common Lisp being a Lisp-2. |
Perhaps that bit doesn't need to be fixed, but here's another weirdness that occurs when you use a quoted symbol as the function: uLisp:
(At least in my version of uLisp, the CL gives the same "not a function name" error with that. After some thought I think at least the first example can be corrected by something like what I mentioned in this comment from a year ago. I'll try it and see if it works. I have no clue how to fix the second one. |
It does the same on Version 4.6, and I can understand why, but I really don't think it's worth spending any time trying to "fix" it. |
I've found a fix. In eval() change:
to
It avoids evaluating the first item in a list if it's a built-in function. Your tests:
It passes the test suite on ARM; I need to test the other platforms. Although as far as I know it has had no impact on users, it is definitely worth fixing because it significantly speeds up uLisp; for example: Tak on an ATSAMD21 on ARM Version 4.6, : 14.0 s So great work finding that! |
There's one thing that your fix doesn't cover:
I just made some changes that also fix the
As opposed to what stock 4.6 does:
|
Not sure this would be more useful than uLisp's current behaviour. |
At the very least, the bug where if you quote |
Thanks for these comments. I've decided to incorporate some of the changes you've made to
where the error should really be:
One thing I don't quite understand in your fork. In this section of
under what conditions will the second "can't call a symbol" error message get triggered? |
I just ran the entire test suite with the second "can't call a symbol" message rigged to crash my ESP32 instead, and it didn't crash. So I think it's pretty well unreachable. I guess I forgot to remove it from something else. One thing that does happen in the test suite now is stuff like this:
because the 1+ is being passed in quoted, and this "transform to a builtin" action isn't allowed to happen. But anyway, that test isn't valid Common Lisp anyway:
I can't figure out the right combination of |
Specifically, I was referring to the fact that if it is a special form (such as |
Yes, there are a couple of tests in the test suite that don't make much sense, and only work in uLisp by accident, so I'm going to remove them. I'll try and find something similar to replace them with.
So you're referring to this example?
What should the error be in this case? Common Lisp effectively gives:
|
I think the best error in that case would be |
On further investigation there is still a problem:
(the |
Yes, thanks, I'll fix that. |
I've tried to fix most of these issues in Release 4.6b of the ESP Version of uLisp, and they'll be fixed in the other versions in due course - thanks for finding them! |
In Common Lisp:
But in uLisp:
Going to have to think about how to fix this.
The text was updated successfully, but these errors were encountered: