# The variables are explained in the file gap/data.g
# name := number;
IF_macaulay := 110;

IF_SUBPACKAGE_VERSION[IF_macaulay] := "dev";


IF_CAS_DESCRIPTION[IF_macaulay] :=
[ "Macaulay 2",
"Macaulay 2 is a software system for algebraic geometry research",
"http://www.math.uiuc.edu/Macaulay2/" ];


IF_EXEC_NAME[IF_macaulay] := "M2";
IF_EXEC_FULL_PATH[IF_macaulay] := "/mnt/hda8/marco/software/matematica/macaulay/Macaulay2-0.9.2/bin/M2";
IF_EXEC_OPTIONS[IF_macaulay] := [ "-silent", "-tty" ];

IF_QUIT_COMMAND[IF_macaulay] := "quit";
IF_DISPLAY_VERSION[IF_macaulay] := "version";


IF_FIRST_COMMAND[IF_macaulay] := "GapType = x -> toString( class ( x ) )";
IF_FIRST_PROMPT[IF_macaulay] := "\ni1 : ";
#IF_PROMPTS[IF_macaulay] := [ " : " ];
IF_PROMPTS[IF_macaulay] := function ( OUT )
    local  p1, p2;
    p1 := 0;
    while true  do
        p1 := PositionSublist( OUT, "\n\ni", p1 );
        if p1 = fail  then
            return false;
        fi;
        p2 := PositionSublist( OUT, " : ", p1 );
        if p2 <> fail and ForAll( OUT{[ p1 + 3 .. p2 - 1 ]}, IsDigitChar )  then
            return true;
        fi;
    od;
end;

IF_FUNC_REMOVE_PROMPT[IF_macaulay] := OUT -> OUT{[ PositionSublist( OUT, " = " ) + 3 .. 
PositionSublist( OUT, "\n\ni" ) - 1 ]};

IF_ASSIGN[IF_macaulay] := "=";
IF_END_COMMAND[IF_macaulay] := "";
IF_IS_THERE_PROMPT[IF_macaulay] := true;
IF_FUNC_TYPE[IF_macaulay] := "GapType";
IF_TYPE_IS_QUOTED[IF_macaulay] := false;

IF_STRING_ARE_QUOTED[IF_macaulay] := false;
IF_FUNC_STRING[IF_macaulay] := "toString";
IF_FUNC_DISPLAY[IF_macaulay] := "toString"; # toExternalString
IF_PROHIBITED_CHARS[IF_macaulay] := [  ];


# http://www.math.uiuc.edu/Macaulay2/Manual/0019.html 
# ;

IF_DATA_TYPES[IF_macaulay] := rec(

ZZ :=[
"the class of all integers",
IsInt,
String,
Int ],

QQ :=[ 
"the class of all rational numbers",
IsRat,
String,
Rat ],

Boolean :=[
"the class of Boolean values",
obj -> IsBool( obj ) and ( obj = true or obj = false ),
String,
obj -> obj = "true" ],

PolynomialRing :=[
"the class of all ordered monoid rings",
IsPolynomialRing,
,
]


);

