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

errorhandling/ behaviour with erroneus code #668

Open
mayerrobert opened this issue Apr 21, 2024 · 3 comments
Open

errorhandling/ behaviour with erroneus code #668

mayerrobert opened this issue Apr 21, 2024 · 3 comments

Comments

@mayerrobert
Copy link

I was fixing/ tinkering with the error handling of my own Lisp and while checking what other Lisps do I noticed some unexpected behaviour in abcl:

CL-USER(1): (typep nil 'xyxxy) ;; sbcl signals simple-error (in the REPL and IMO erroneously does not signal in compiled code)
NIL

CL-USER(2): (typep 1 'xyxxy) ;; sbcl signals simple-error
NIL

CL-USER(3): (read-from-string "#\Bla")
;; signals error, should probably signal reader-error

CL-USER(4): (read-from-string "(xyxxy . 1 2)") ;; sbcl signals simple-reader-error "More than one object follows . in list."
(XYXXY 2)
13

FYI:
CL-USER(5): (lisp-implementation-version)
"1.9.2"
"OpenJDK_64-Bit_Server_VM-Oracle_Corporation-18.0.1+10-24"
"amd64-Windows_10-10.0"

I'm not a 100% sure if the Common Lisp spec requires the above to be fixed or if these are cases of "implementations should..." so feel free to ignore/ proceed as you see fit.

@alejandrozf
Copy link

The page for cl:typep in CLHS says: The consequences are undefined if the type-specifier is not a type-specifier.
So, for the first 2 examples the implementation is not required to signal a type-error.

@alejandrozf
Copy link

For the third one I think the standard requires an error but not specifically a reader-error. But I think it shouldn't be difficult to change it to reader-error for better information to the user.

@alejandrozf
Copy link

And the last one would be a bug IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants