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

Macro mistakes #270

Merged
merged 47 commits into from
Nov 10, 2024
Merged

Macro mistakes #270

merged 47 commits into from
Nov 10, 2024

Conversation

gilch
Copy link
Owner

@gilch gilch commented Nov 9, 2024

This branch both fixes mistakes and maybe makes some more, in the sense of feature creep. This has taken literally months. I've added a lot more, which will (hopefully) make even standalone Hissp more practical for real-world use.

Resolves #259.
Resolves #173.

Those were my only blockers for the next release. I'll merge this in, give the docs a once over, and the next branch after that will be for the release!

Hissp's design still has a few imperfections that I don't have solutions for. I think I need to dogfood Lissp a lot and catch up Hebigo (and maybe Garden of EDN as well) before advancing Hissp any more than this. I will, of course, fix any serious bugs I discover, but Hissp will be in a feature freeze for the time being.

gilch added 30 commits October 16, 2024 20:57
Some reference links I was using broke. 3.10 is currently the minimum supported Python version.
Expansion is shorter and more readable now. I haven't profiled, but fun definitions should be mostly top-level.
Longer bytes were of low value for the extra time they were taking.
Now uses _resolve_env() to walk up the stack like macroexpand and friends, and like evaluate/execute.

It no longer makes an empty environment, you'd have to pass it explicitly.
$foo= should correspond to my.$foo
It's awesome.
100% test coverage!
gilch added 15 commits October 30, 2024 09:35
Clarify that reserved identifiers are still symbols
And make macro_context env argument not optional.
_macro_ keys should be identifiers.
There's no valid use for `.` in local tags, so munge as if escaped.
Add sentinel# tag
Add See also linking en# @
Add See also links for names that may be confused
And use it for intermediate expansions in macroexpand_all
Per style guide, tags should be named for their minimum arity, but it was called @## even though we had !# consistently.
Should happen right before the return, not before a preprocess call in some cases.
@gilch
Copy link
Owner Author

gilch commented Nov 9, 2024

Ugh. Test runner floating-point hardware has different rounding errors than mine. I thought these would be more standardized. There are a lot of test examples using floats. I wonder if the precision is adjustable somehow. Maybe I can add rounding in a few places. That would make the output a bit easier to read, at the cost of some minor complication elsewhere.

gilch added 2 commits November 9, 2024 16:19
This is a lot more readable, at the cost of another distraction.

The GitHub test runner was getting slightly different float answers in some cases. Rounding should fix those.
Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (72e199f) to head (0021e5d).
Report is 48 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master      #270      +/-   ##
===========================================
+ Coverage   96.62%   100.00%   +3.37%     
===========================================
  Files           6         6              
  Lines         830       833       +3     
  Branches      127       110      -17     
===========================================
+ Hits          802       833      +31     
+ Misses         20         0      -20     
+ Partials        8         0       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gilch gilch merged commit 5f85883 into master Nov 10, 2024
3 checks passed
@gilch gilch deleted the macro-mistakes branch November 10, 2024 00:17
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.

Write a symbol macro let walkthrough macroexpansion could be easier
1 participant