#+ and #- operators to replace (an+b) function.
#36
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.
Description
Nthtype renamed toAnPlusB(inspired by csstree)EvenandOddconstructors dropped in favor of a singleAnPlusBconstructornthfunction replaced by the operators#+and#-evenandoddfunctions just useAnPlusBconstructor and are rendered as equivalent formulas (2nand2n+1respectively).Design considerations
nthChild (nth 2 1)is a bit repetitive and doesn't look much like the an+b format. Therefore it might be unclear at first what the parameters represent.anplusbas I would have considered that to have stronger semantics thannth. But then I got the idea to add these operators instead.Nthdata type is less clear thanAnPlusB.EvenandOddconstructors was mostly just about simplifying things. But there is an incremental performance benefit also, in that2nand2n+1add up to 6 characters in total, whileevenandoddadd up to 7 characters. Thus, the rendered output will be slightly more compact.Future plans
N/A
References
evenandoddformula equivalents)Code change checklist