
InstallDocumentation(rec(
name := "Comment",
kind := "KEYWORD",
short := "Comments in KASH3 start with '#'.  All text on a line after '#' "+
"is ignored by KASH3.",
ex := ["# this is a comment"]
));


#/*TEX***TEX***TEX***TEX***TEX***TEX***TEX***TEX***TEX***TEX***TEX***TEX***TEX*
#
#USERDEF   
#
#FXN       GAP
#
#SHORTDOC  GAP-Emulation-Mode  
#
#LONGDOC   Initializes the GAP3 (groups algorithms and programing) emulation
#          mode.  Not all functions are available.  There is NO DOCUMENTATION.         
#          Please see the GAP3 documentation for a description of the functions.
#
#EXAMPLE   @
#          GAP();
#
#**HISTORY*|*HISTORY***HISTORY***HISTORY***HISTORY***HISTORY***HISTORY**HISTORY
#
#**KASH***KASH***KASH***KASH***KASH***KASH***KASH***KASH***KASH***KASH***KASH*/

InstallDocumentation(rec(
kind := "FUNCTION",
name := "GAP",
sin := [],
sou := [],
short :=
"Initializes the GAP3 (groups algorithms and programing) emulation "+
"mode.  Not all functions are available.   KASH3 provides NO DOCUMENTATION. "+
"Please refer to the GAP3 documentation for a description of the functions."
));

GAP := function()
  ReadLib("../gap/lib/gap.kash");
  Print("\n");
end;

InstallDocumentation(rec(
kind := "FUNCTION",
name := "IsOdd",
sin := [[elt-ord^rat,"b"]],
sou := [[elt-alg^boo]],
short :=
"Return 'TRUE' if 'b' is odd",
ex :=  ["IsOdd(5)"],
see := [DocHash("IsEven(elt-ord^rat)")]
));

#####################################################################

IsOdd := function(b)
  return not IsEven(b);
end;

#####################################################################

_BindNames_ := function(S,L)
local i;

  AssignNames_(S,L);
  for i in [1..Size(L)] do
    Bind(L[i],S.(i));
  od;
end; 

InstallMethod(
rec(
kind := "FUNCTION",
name := "BindNames_",
sin := [[str,"S"],[list,"L"]],
short :=
"Define global variables whose names are given in 'L' which contain the generators of 'S'",
ex :=  ["CY := PolynomialAlgebra(C); BindNames_(CY,[\"Y\"]);"],
see := [DocHash("BindName_(str,string)"),DocHash("AssignNames_(rng,seq(string))")]
),_BindNames_);


_BindName_ := function(S,name)

  AssignNames_(S,[name]);
  Bind(name,S.1);
end; 

InstallMethod(
rec(
kind := "FUNCTION",
name := "BindName_",
sin := [[str,"S"],[string,"name"]],
short :=
"Define a global variables whose name is given by 'name' which contains the (first) generator of 'S'",
ex :=  ["CY := PolynomialAlgebra(C); BindName_(CY,\"Y\");"],
see := [DocHash("BindNames_(str,list)"),DocHash("AssignNames_(rng,seq(string))")]
),_BindName_);

######################################################################

__VERBOSE:= Alist();

SetVerbose:= function(s,n)
PutAssoc_(__VERBOSE,s,n);
end;

GetVerbose:= function(s)
return Assoc(__VERBOSE,s);
end;

