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

Add alias and prelude shorthand tags #258

Merged
merged 3 commits into from
Jul 19, 2024
Merged

Add alias and prelude shorthand tags #258

merged 3 commits into from
Jul 19, 2024

Conversation

gilch
Copy link
Owner

@gilch gilch commented Jul 19, 2024

Now you can say

hissp..prelude#:

instead of the longer

(hissp.._macro_.prelude)
;; or
(hissp.macros.._macro_.prelude)

although any of them work. While a : argument uses the current module's global namespace, you can specify a different one (e.g., to get Ensue without all the star imports, see the wiki). This should be considered the current standard way to do it (at least for Hissp 0.5), but we're still not to 1.0, and things that have changed recently are less likely to be stable. I'm still considering the alternatives in #257 for after version 0.5.

The main alternative to the prelude is alias, which now also has a shorthand tag.

hissp..alias## spam foo.bar.

If you don't specify the qualifier, it assumes you want the bundled macros. This usage is now demonstrated in test_macros.lissp with the following line:

hissp..alias#*

Shorthand tags for the first form of a module to initialize the other local or aliased macros.
@gilch
Copy link
Owner Author

gilch commented Jul 19, 2024

Ah, so that's why I was using suppress instead of a try/except before. Those lines aren't really reachable by the tests. I might change that back later. I was at "100%" code coverage at one point, but I can't generate coverage data for the .lissp modules, so that was probably illusory even at the time. I do have extensive doctests for the macros, but there are probably some edge cases I missed. "Covered" doesn't actually mean tested, although "not covered" means it isn't (automatically). I'd eventually like to try mutation testing #46, but I'm not sure how to make that work on the .lissp either. I might have to implement it myself.

@gilch
Copy link
Owner Author

gilch commented Jul 19, 2024

Tests are green now, even if I lost a little coverage percentage. Merging.

@gilch gilch merged commit 22f1a87 into master Jul 19, 2024
1 of 3 checks passed
@gilch gilch deleted the alias branch July 19, 2024 21:23
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.

1 participant