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

Support for pprint of backquote forms, adapted from SBCL #459

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alanruttenberg
Copy link
Collaborator

@alanruttenberg alanruttenberg commented Feb 28, 2022

(pprint '`(b ,a)) -> `(b ,a)

Instead of

(system::backq-list 'b a)

@easye easye self-requested a review March 10, 2022 07:01
Copy link
Collaborator

@easye easye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit fails five more ANSI-TESTS--namely PRINT.BACKQUOTE.RANDOM.6
PRINT.BACKQUOTE.RANDOM.7, PRINT.BACKQUOTE.RANDOM.8, PRINT.BACKQUOTE.RANDOM.9, and PRINT.BACKQUOTE.RANDOM.12--which should be investigated.

@alanruttenberg
Copy link
Collaborator Author

If you look at .6 it's testing '`(,@A ,@b). But if you look at the output it is actually testing (system::backq-append) i.e it's lost the splices. The output is a bunch of printer bindings which the printing is tested under. If you bind those variables and pprint '`(,@A ,@b) it prints fine.

I think the problem is in the tests. The code for those tests reads:

(randomly-check-readability (list (car x)) :test #'is-similar)

but should be

(randomly-check-readability x :test #'is-similar)

By doing that the test is effectively for nil. But `nil is read a nil because we don't have a quasiquote operator, and the reader is even dropping the quote - it does that for any self-evaluating form.

I submitted an issue at the ansi-test repo

@alanruttenberg
Copy link
Collaborator Author

Oh, and those tests fail even without the pull

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

Successfully merging this pull request may close these issues.

2 participants