
# The following function is not reliable: an object may contain unsupported sub-obects, or a
# TryNextMethod may occur.

IF_IsSupportedByGapOpenmath := function ( o )
    local  s, r;
    s := OutputTextNone(  );
    r := ApplicableMethod( OMPut, [ s, o ] );
    CloseStream( s );
    return r <> fail;
end;



IF_ConvertGapObjectToOpenmathString := function ( o )
    local  s, t;
    t := "";
    s := OutputTextString( t, false );
    OMPutObject( s, o );
    CloseStream( s );
    return t;
end;



IF_ConvertOpenmathStringToGapObject :=  function ( t )
    local  p, s;
    s := InputTextString( t );
    p := OMGetObject( s );
    CloseStream( s );
    return p;
end;
