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

Intro rewrites #266

Merged
merged 26 commits into from
Oct 5, 2024
Merged

Intro rewrites #266

merged 26 commits into from
Oct 5, 2024

Conversation

gilch
Copy link
Owner

@gilch gilch commented Oct 5, 2024

Reworked the Whirlwind Tour quite a bit.

Upgraded to Python 3.10, since it's already October. Resolves #261.
Did some code cleanup along with that.

Fixed various bugs discovered from carefully reading the docs, including a serious one involving gensym hash data getting reset too soon. I've added tests for that one.

Moved to Advanced section.
It's now a code-walking macro.
Allow more types in discard comments.

Clarify some cond cases and separator comments.
ENV is no longer MappingProxyType.
Macros can now theoretically cause expansion environment mutations at expansion time.
In a couple of places where it would help. It was fewer than expected.
Previously a slice. The method wasn't available until Python 3.9.
This doesn't work correctly if the module itself is a package. But the __init__ file is not supposed to be compiled, because it's supposed to have the transpile call in the first place. This is not a serious limitation, because `__init__.py` can do an `import *` from a Lissp module imported after the transpile.
And some minor refactoring.
Use more consistent exception message style
Defaults to caller's globals, like eval() and exec().
Fix invalid escape sequence
Different repr, but essentially the same answer on the GitHub workflow runner.
I'm also skipping black formatting in a few areas, including readerless mode code, which has different rules.
This fixes a serious bug in how gensym hashes were generated.
Test gensyms for reproducible builds

Test equal gensyms in same template

Test successive gensyms unequal

Test gensyms include __name__ in hash

Test subrepl tag
'quoted was partially blue.
@gilch
Copy link
Owner Author

gilch commented Oct 5, 2024

Looks like doc and test changes improved coverage significantly. There are still some more lines I want to cover. #259 should help cover macroexpand_all some more. Uncovered error cases will probably need individual unit tests.

This one is in a good state now. I feel like I need to sync up.

@gilch gilch merged commit 2047797 into master Oct 5, 2024
3 checks passed
@gilch gilch deleted the intro-rewrites branch October 5, 2024 01:26
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.

Stop supporting Python 3.8
1 participant