-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Mostly doc updates. And macro improvements. #263
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sphinx likes to generate a few files for inclusion with documentation source with normal usage, but they don't include copyright and license information, so they probably don't care to enforce it. (Just being thorough.)
The macroexpand_all() documentation is more clear this way than for a couple of opaque lambdas as before.
I don't think you'll need a link to document a builtin here. The alternatives might be `globals` or `globals()<globals>`, which seem even more confusing.
This is closer to GitHub's icon for it.
Linter wants me to use \ instead, but I think this is more legible.
Increase gensym prefix separation for legibility fix inconsistent indent Simplify Compiler.body Add drop for lambda as default edge case fix README fix whirlwind tour fix primer fix compiler doctest fix inner gensym test fix test_cmd fix macro_tutorial fix macros docstrings
Compile lambda params on one line in simple cases fix lissp_whirlwind_tour.rst fix README.md fix macro_tutorial.rst fix primer.rst fix Compiler.function docstring fix macros.lissp docstrings
And rewrite in readerless.
Add Shadowing subsection Add Prefer Shorter Definitions subsection Add Newlines subsection Expand Comment Styles intro and rationale
up to section 15
ParseLissp error messages now show full compiled output without genysm normalization (in addition to the normed diff), to make doctest updates easier.
Methods should now be defined after the class in most cases. This allows module reloads to patch in existing instaces. `define` and derivatives (bundled macros beginning with `def`) can now define attributes anywhere, not just globals. `set@` and `zap@` can now define globals as well. Unlike a def, they return the value assigned. The decorator tag `@#` is now compatible with methods, but not classes, but `once-defftype` has a body of decorators to be applied once and reloadable class decorators can be applied afterward using `zap@`.
Now in terms of the more correct `fun`. Use a SimpleNamespace for hissp.macros._macro_ Rename once-deftype to deftypeonce Rename once-define to defonce again
Enables a more compact style that's still aligned. Use "tag" in place of "reader macro" in definitions
Yep, losing coverage percentage. Mosty due to new features. I think they're working from manual tests, but I'll fix this before the next release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Still insufficient documentation/tests for a release, but I need to sync this branch up.
Added
hissp..refresh#
andhissp..subrepl#
convenience tags. These are meant for interactive use in the REPL. Only manually tested, but worked.Reworded lambda text layout. Resolves #262. I found a balance between readability and simplicity I'm reasonably happy with. It sure broke a lot of tests though. I improved the Sybil doctest error messages to make these kinds of test fixes easier.
New
deftypeonce
replacesdeftype
. It no longer accepts attributes directly, but can take once-decorators (meaning they don't run again on a reload), which could add attributes, if necessary. Most attributes should be added externally instead, usingdefine
or the newdefun
, which can now target attr paths, not just globals. (This makesset@
feel a little redundant, but that returns the value.define
/defun
don't.) This setup will patch in method changes to existing instances on a module reload, which makes it feel more like CLOS. The decorator tag@##
now works on methods, if made withdefun
. It can work ondeftypeonce
as well, but be careful with those. They will re-run on reload, so make sure they're idempotent.set@
/zap@
are now based ondefine
, so they can now also target globals.zap@
is good for applying decorators post-definition.Reworked
defmacro
in terms of new macrofun
, which is a named lambda with optional docstring. (Naturally,defun
was also based on this.) Python puts names in three different places for some reason. Adding all those attributes in line is kind of verbose compared to a simple lambda, but is probably worth it for top-level definitions. Adefun
can also define a function in the_macro_
namespace, if it exists. This makesdefmacro
feel a little redundant, but it will create a_macro_
for you if you don't have one.Renamed
<<#
to<#
, enabling the more compact aligned style now recommended in the style guide.