Skip to content

Prettier munging#307

Merged
gilch merged 2 commits into
masterfrom
prettier-munging
Jun 27, 2026
Merged

Prettier munging#307
gilch merged 2 commits into
masterfrom
prettier-munging

Conversation

@gilch

@gilch gilch commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Closes #302.
Closes #289.
Closes #288.
Closes #278.

Deep and interrelated changes this time. Rewriting all the tests for each increment would have been a lot of extra work for little benefit, so I had to squash them. Rewriting them once was still a lot of work.

Hissp needs to be imported to recompile the macros, but then we need to import the (possibly) new version instead. The patch clears the cache of the old version.
@gilch

gilch commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

I'm kind of surprised that wasn't already covered. Looks like I need one more test for a couple of the new lines.

@gilch

gilch commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

Hmm. OK. This is a bit more of an edge case than I thought when I saw the lines in isolation. It makes sense why it isn't covered now. Typically, we'd expect the compiler to have access to the same modules as run time, especially during incremental development. But this doesn't necessarily hold.

The compiler need not necessarily run on the same version of Python as what is used at run time, which could certainly imply a different set of installed modules. For example, the standalone property means you don't need the hissp package installed unless you're using it at run time.

But it could also go the other way, with the run time having access to extra modules. For example, modules might be dynamically generated as I'm considering in #280. The Brython example in the README would be another case. In that example, the compiler running on a standard Python distribution has no access to the browser. module, but it compiles Lissp code to Python that uses it on the front end. We can't have the compiler rewrite (browser..foo- to (browser.._macro_.foo- and then balk when it can't import the module, because it might be a normal function call that would work fine at run time. Compiling like a function call would be the right behavior.

I think the code is correct as-is and the try: statement with the uncovered lines can't simply be removed. I need to test this. I can probably just compile some code referring to a bogus module without actually running it, but make sure it looks like a function call. I'll try that.

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (15a3f8d) to head (2127fa1).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #307   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          840       832    -8     
  Branches       113       113           
=========================================
- Hits           840       832    -8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gilch

gilch commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

That wasn't too bad. I'll squash that in too.

Eradicate QzMaybe
Simplify alias
Make .# multiary
@gilch gilch force-pushed the prettier-munging branch from 7fc9642 to 2127fa1 Compare June 27, 2026 18:54
@gilch gilch merged commit 660a32c into master Jun 27, 2026
3 checks passed
@gilch gilch deleted the prettier-munging branch June 27, 2026 18:56
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.

prettier munging .# should be multiary You shouldn't need to say _macro_ alias not allowing zero argument tags

1 participant