provide facility to bind element names
This commit is contained in:
parent
88533fd7de
commit
87e7b01333
@ -254,6 +254,30 @@ function( Q, name )
|
||||
F := FamilyObj( Representative( Q ) );
|
||||
F!.elmNamePrefix := name;
|
||||
end);
|
||||
#############################################################################
|
||||
##
|
||||
#O BindElmNames( M )
|
||||
##
|
||||
## For each element e of the magma <M>, binds the identifier named String(e)
|
||||
## to e.
|
||||
## collection <C>. For quasigroups, loops, and possibly related structures
|
||||
## this changes the prefix with which the elements of that family are printed.
|
||||
|
||||
InstallMethod( BindElmNames, "for a magma",
|
||||
[ IsMagma ],
|
||||
function( M )
|
||||
local e, nm;
|
||||
for e in Elements(M) do
|
||||
nm := String(e);
|
||||
BindGlobal(nm, e);
|
||||
MakeReadWriteGlobal(nm);
|
||||
od;
|
||||
return;
|
||||
end);
|
||||
|
||||
F := FamilyObj( Representative( Q ) );
|
||||
F!.elmNamePrefix := name;
|
||||
end);
|
||||
|
||||
#############################################################################
|
||||
##
|
||||
|
Loading…
Reference in New Issue
Block a user