Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #74 +/- ##
==========================================
- Coverage 99.88% 99.88% -0.01%
==========================================
Files 509 510 +1
Lines 373210 373386 +176
==========================================
+ Hits 372793 372966 +173
- Misses 417 420 +3
🚀 New features to boost your workflow:
|
Extending the library meant allocating two numbers and filling six global arrays; SOTGrps spends 70 lines on it, sglppow the same. Nothing checked that two packages picked different slots, and load order decided which of two overlapping layers won. A layer is now one record. It carries a name, which is what other layers refer to it by: `before` and `after` name the layers this one wants to be consulted before or after, and a name that is not registered is ignored, so wishing about a package that is not loaded does no harm. Neither number is the layer's business any more -- `available` is wrapped so that `lib` and `func` are filled in on the way out, which is also what lets a later registration reorder earlier ones. Registered layers take consecutive slots behind every layer added the old way, so registering one never moves another across a slot this code did not hand out, and released sglppow and SOTGrps keep working unchanged. Ported SOTGrps' Integration.gi as a check: 70 lines to 20, and its own test suite passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The layers of this package become one layer named "SmallGrp", whose methods read the global arrays a layer used to be installed in -- and so also cover those still added that way from outside. Every other layer is a record of the same shape appended after it, and SMALL_AVAILABLE hands the layer that answered back in the inforec, so the high-level functions call its methods directly. What this deletes: the slot arithmetic over eight arrays, the layer and func numbers a registered layer carried, and all of the placement code -- the relocation rule and its hazard go with it, since a layer added the old way is now inside "SmallGrp" rather than between two registered ones. Two components the record gained, because the compat layer cannot be expressed without them: 'idAvailable', since the identification covers other orders than the construction and under other func numbers (id2 stops at 1000, id3 uses func 13, which SMALL_GROUP_FUNCS does not even have), and 'properties', the indexing hook, which registered layers previously had no way to supply. Naming a layer in 'before' now includes "SmallGrp", so a layer may put itself in front of this library. Nothing under small*/ or id*/ is touched: those read inforec.func and inforec.lib, and "SmallGrp" hands their own inforec straight back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or 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
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.
Closes #67.
Extending the library means allocating two numbers and filling six global arrays. SOTGrps spends 70 lines on it, sglppow the same. This is very brittle, e.g. nothing checks that two packages pick different slots, and load order decides which of two overlapping layers wins.
With this PR, adding a new layer can be done with a simple function call:
nameis what other layers refer to a layer by.beforeandaftername the layers this one wants consulted before or after; a name that is not registered is ignored, so wishing about a package that is not loaded does no harm, and wishes that cannot all be met are refused before anything is written. The registered layers are collected inSMALL_GROUPS_LAYERS.Compatibility
The old route is untouched, so released
sglppowandSOTGrpskeep working. But new versions of those will make use of this new function, see gap-packages/sotgrps#58 and gap-packages/sglppow#13For the time being, The eleven layers of this package keep their numbers and are not registered by name. This may or may not change in the future.
Care was taken to test various combinations of old versus new for sglppow/sotgrps/smallgrp, and everything worked fine.