-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend BindConstant, MakeConstantGlobal to all object types
Currently we only support these on integer and boolean values. This patch extends this to all object types. This would then simply be a "non-reversible" version of `MakeReadOnlyGlobal`; i.e., unlike that, a "constant global variables" can never be turned into a non-constant one. That is, it will always refer to the same object. Semantically this interpretation of `constness` is in line with other languages, such as Julia, where `const` refers to the (re)assignability of a variable identifier, *not* to the mutability of the object it refers to. (Note that this is admittedly somewhat confusing in GAP, with `MakeReadOnlyGlobal`/`MakeReadOnlyGVar` doing one thing and `MakeReadOnlyObj` doing something orthogonal (and for now only in HPC-GAP.... Note that no further use is made of this for now; in particular, unlike for small integer values, `true` and `false`, no attempt is made to "inline" constant object in function definitions. However, interfaces to other languages (such as the GAP-Julia interface) could exploit constness for various optimizations.
- Loading branch information
Showing
4 changed files
with
12 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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