From 87e7b01333fb7d9e34d604c1ef67ce27bba13a21 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Thu, 19 Oct 2017 02:08:47 +0200 Subject: [PATCH] provide facility to bind element names --- gap/quasigroups.gi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gap/quasigroups.gi b/gap/quasigroups.gi index 54df1f6..5d9ea35 100644 --- a/gap/quasigroups.gi +++ b/gap/quasigroups.gi @@ -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 , binds the identifier named String(e) +## to e. +## collection . 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); ############################################################################# ##