gilch / hissp

It's Python with a Lissp.
https://gitter.im/hissp-lang/community
Apache License 2.0
369 stars 9 forks source link

Inject `if-else` #199

Closed gilch closed 1 year ago

gilch commented 1 year ago

Closes #198, although maybe some follow-up is warranted if this kind of thing can be done for other inlined helpers.

codecov[bot] commented 1 year ago

Codecov Report

Merging #199 (bc0a59c) into master (8d815b5) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #199   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          700       700           
  Branches       111       111           
=========================================
  Hits           700       700           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

gilch commented 1 year ago

OK quite a bit of follow-up. There were a number of other macros with inline helpers that could be simplified with Python injections.

That shortened expansions quite a bit, at the cost of more complicated macro implementations, and more opaque inlined helpers. I can actually read a lot of the Python compilations without getting lost in the noise now. (The noise is really due to the zero-dependency requirement of the bundled macros, which allows their expansions to work without a Hissp install. Hebigo's expansions use imported helper functions are much less verbose.)

gilch commented 1 year ago

The when / unless example in the Whirlwind Tour got deleted. I couldn't just move it because it was testing both. If I were to put it in one or the other, one would still be lacking an example, and if I duplicated it, it would be duplicated. I need to remember to write new examples for those. They could probably be pretty similar.