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

IF_SUBPACKAGE_VERSION[IF_cocoa] := "dev";


IF_CAS_DESCRIPTION[IF_cocoa] :=
[ "CoCoA",
"COmputations in COmmutative Algebra",
"http://cocoa.dima.unige.it/" ];



IF_EXEC_NAME[IF_cocoa] := "cocoa";
#IF_EXEC_FULL_PATH[IF_cocoa] := "";
IF_EXEC_OPTIONS[IF_cocoa] := [];

IF_QUIT_COMMAND[IF_cocoa] := ";Quit;";
IF_DISPLAY_VERSION[IF_cocoa] := "";


# IF_FIRST_COMMAND[IF_cocoa] := "";
IF_FIRST_PROMPT[IF_cocoa] := ";\n-------------------------------\n";
IF_PROMPTS[IF_cocoa] :=["\n-------------------------------\n"];
IF_FUNC_REMOVE_PROMPT[IF_cocoa] := OUT -> ReplacedString( OUT, IF_PROMPTS[IF_cocoa][1], "" );

IF_ASSIGN[IF_cocoa] := ":=";
IF_END_COMMAND[IF_cocoa] := ";";
IF_IS_THERE_PROMPT[IF_cocoa] := false;
IF_FUNC_TYPE[IF_cocoa] := "Type";
IF_TYPE_IS_QUOTED[IF_cocoa] := false;

IF_STRING_ARE_QUOTED[IF_cocoa] := false;
IF_FUNC_STRING[IF_cocoa] := "Sprint";
IF_FUNC_DISPLAY[IF_cocoa] := "";
IF_PROHIBITED_CHARS[IF_cocoa] := [ 34, 92, 255 ];



IF_DATA_TYPES[IF_cocoa] := rec(

BOOL := [
"A boolean.  The boolean constants are TRUE and FALSE.", 
obj -> IsBool( obj ) and ( obj = true or obj = false ),
function( obj ) if obj  then return "TRUE"; else return "FALSE"; fi; end,
obj -> obj = "TRUE" ],

DEVICE := [
"For input/output.", ],

ERROR := [
"Objects of this type are used in error-handling.", ],

FUNCTION := [
"A CoCoA-defined function.",
IsFunction, ],

IDEAL := [
"An ideal.", ],

INT := [
"An arbitrary precision integer.", 
IsInt,
String,
Int ],

MAT := [
"A matrix.", ],

MODULE := [
"A submodule of a free module.", ],

NULL := [
"The null constant is Null.", ],

POLY := [
"A polynomial.", ],

RAT := [
"An arbitrary precision rational number.",
IsRat,
String,
Rat ],

RATFUN := [
"A rational function.", ],

RECORD := [
"A record is a set of bindings, name --> object.", ],

RING := [
"A base ring, a polynomial ring, or a quotient ring.", ],

STRING := [
"A string.",
IsString and IsStringRep,
IF_ParseGapString,
IdFunc ],

TAGGED := [
"Used to help in printing complicated objects.", ],

TYPE := [
"Returned by the function 'Type', for example.",
,
,
IdFunc ],

VECTOR := [
"A vector.", ],

ZMOD := [
"An integer modulo another integer, e.g. 3 % 5.", 
IsZmodnZObj,
obj -> Concatenation( String( obj![1] ), " % ", String( DataType( TypeObj( obj ) ) ) ),
function ( obj )
    local  p;
    p := Position( obj, '%' );
    return ZmodnZObj( Int( obj{[ 1 .. p - 2 ]} ), Int( obj{[ p + 2 .. Length( obj ) ]} ) );
end ],

# "LIST" must be done after MAT, STRING, VECTOR
LIST := [
"A list.",
obj -> IsDenseList( obj ) and ForAll( obj, y -> IF_Type(IF_cocoa, y) <> fail ) ]


);

