kernel: use IS_MUTABLE_OBJ in UNB_LIST/ASS_LIST/ASSS_LIST#6023
kernel: use IS_MUTABLE_OBJ in UNB_LIST/ASS_LIST/ASSS_LIST#6023ChrisJefferson merged 1 commit intomasterfrom
IS_MUTABLE_OBJ in UNB_LIST/ASS_LIST/ASSS_LIST#6023Conversation
8e2e6fa to
59b05e7
Compare
59b05e7 to
2820fcf
Compare
2820fcf to
b6c73bc
Compare
|
OK, this causes test failures in GAP.jl and those are genuine failures. What needs to be determined is if they are to be considered a bug in there, or fair use which this PR incorrectly excludes (i.e. whether I should adjust this patch, or else GAP.jl). Specifically, in GAP.jl we create special GAP objects with tnum However, elsewhere in GAP, immutability is not the same as read-only -- a concept vanilla GAP doesn't have at all, but HPC-GAP does. Indeed, GAP component objects can be immutable and at the same time be writable (e.g. groups objects are immutable, but can store new attributes). When it comes to e.g. lists-of-lists, then "immutable" is meant to be "recursive". I can now see arguments both ways:
Regarding point 2, the justification might be that "other component objects also do it" -- but I'm not convinced this is a good argument. Sure, a GAP group can "learn" new information, but that's not supposed to "change its mathematical content". This is still rather fuzzy, but I always took it as "all the extra data can be recomputed in principle, at least up to some equivalence" (e.g. asking for a Sylow But if I do Here's another argument for the current state 2: if you do Here is my plan for now:
|
|
So, while Immutable has always been a bit strange in GAP, I do agree I view things as "mathematically immutable", even if they can gain / change information (the most extreme case being stabilizer chains on groups)! In terms of Julia objects, the same problem occurs, in principal, when we wrap any external object, my first stab at "rules" for things like Julia lists would be:
|
IS_MUTABLE_OBJ in UNB_LIST/ASS_LIST/ASSS_LIST
|
To be clear, the Julia "wrapper object" is immutable, it always points at the same Julia object for its entire life time. But the object it points to could be anything... Anyway, I did run the package tests, and looking at https://github.com/gap-system/PackageDistro/actions/runs/15966396075 the changes in this PR would break ~16 packages (4 of those in the report are already broken right now), including most or all of the Homalg and CAP project, so it's a no-go anyway. |
b6c73bc to
d4e345f
Compare
|
The new version should work, but it's less clear why we should merge it separately instead of as part of PR #6025 ... |
d4e345f to
2fd680c
Compare
This might loose us a nanosecond here or there
but it actually gains us something, too: uniform rejecting of write attempts to immutable lists, even if the lists are external objects.