  
  [1X3 [33X[0;0YConversions between [5XGAP[105X[101X[1X and [5XJulia[105X[101X[1X[133X[101X
  
  
  [1X3.1 [33X[0;0YConversion rules[133X[101X
  
  
  [1X3.1-1 [33X[0;0YGuiding principles[133X[101X
  
  [8XAvoid conversions, use wrapper objects instead.[108X
        [33X[0;6YNaively,  one  may think that in order to use [5XJulia[105X functionality from
        [5XGAP[105X,  one  has  to  convert all data to a format usable by [5XJulia[105X, then
        call  [5XJulia[105X functions on that data, and finally convert it back; rinse
        and  repeat.  While  this  is  certainly  sometimes so, in many cases,
        things are a bit different: Some initial (usually very small) data may
        need to be converted. But afterwards, the output of one [5XJulia[105X function
        is  used  as  input of the next one, and so on. Converting the data to
        [5XGAP[105X  format and back then is needlessly wasteful. It is much better to
        not  perform  any  conversion here. Instead, we create special [21Xwrapper[121X
        objects  on  the  [5XGAP[105X  side,  which wraps a given [5XJulia[105X object without
        converting  it.  This  operation  is thus very cheap, both in terms of
        performance  and  in  memory  usage. Such a wrapped object can then be
        transparently used as input for [5XJulia[105X functions.[133X
  
        [33X[0;6YOn  the  [5XGAP[105X  C kernel level, the internal functions used for this are
        [10XNewJuliaObj[110X,  [10XIS_JULIA_OBJ[110X,  [10XGET_JULIA_OBJ[110X. On the [5XGAP[105X language level,
        this  is [2XIsJuliaObject[102X ([14X2.1-1[114X). On the [5XJulia[105X side, there is usually no
        need  for  a wrapper, as (thanks to the shared garbage collector) most
        [5XGAP[105X  objects  are valid [5XJulia[105X objects of type [10XGapObj[110X. The exception to
        that rule are immediate [5XGAP[105X objects, more on that in the next section.[133X
  
  [8XPerform automatic conversions only if absolutely necessary, or if unambiguous and free.[108X
        [33X[0;6YAny  conversion which the user cannot prevent, and which has some cost
        or choice involved, may cause several problems. The added overhead may
        turn an otherwise reasonable computation into an infeasible one (think
        about   a   conversion  triggered  several  million  times).  And  the
        conversion can add extra complications if one wants to detect and undo
        it.[133X
  
  [8XProvide explicit conversion functions for as many data types as possible.[108X
        [33X[0;6YWhile  users  should  not  be forced into conversions, it nevertheless
        should  be possible to perform sensible conversions. The simpler it is
        to do so, the easier it is to use the interface.[133X
  
  [8XConversion round trip fidelity.[108X
        [33X[0;6YIf  an  object  is  converted  from [5XJulia[105X to [5XGAP[105X and back to [5XJulia[105X (or
        conversely,  from  [5XGAP[105X  to  [5XJulia[105X  and  back to [5XGAP[105X), then ideally the
        result should be equal and of equal type to the original value. At the
        very  least,  the  automatic conversions should follow this principle.
        This  is not always possible, due to mismatches in existing types, but
        we strive to get as close as possible.[133X
  
  
  [1X3.1-2 [33X[0;0YAutomatic (implicit) conversions[133X[101X
  
  [33X[0;0Y[5XGAP[105X  has  a  notion of [21Ximmediate[121X objects, whose values are stored inside the
  [21Xpointer[121X referencing them. [5XGAP[105X uses this to store small integers and elements
  of small finite fields, see for example the beginning of Chapter [14X'Reference:
  Integers'[114X  in  the [5XGAP[105X Reference Manual. Since these are not valid pointers,
  [5XJulia[105X  cannot  treat  them  like  other  [5XGAP[105X objects, which are simply [5XJulia[105X
  objects  of type [10XGapObj[110X. Instead, a conversion is unavoidable, at least when
  immediate objects are passed as stand-alone arguments to a function.[133X
  
  [33X[0;0YTo  this end, the interface converts [5XGAP[105X immediate integers into [5XJulia[105X [10XInt64[110X
  objects,  and vice versa. However, [5XGAP[105X immediate integers on a 64 bit system
  can  only  store  61  bits,  so  not  all [10XInt64[110Xobjects can be converted into
  immediate  integers;  integers  exceeding  the  61  bits limit are therefore
  wrapped like any other [5XJulia[105X object. Other [5XJulia[105X integer types, like [10XUInt64[110X,
  [10XInt32[110X, are also wrapped by default, in order to ensure that conversion round
  trips do not arbitrary change object types.[133X
  
  [33X[0;0YAll  automatic  conversions  and  wrappings  are  handled on the C functions
  [10Xjulia_gap[110X and [10Xgap_julia[110X in [5XJuliaInterface[105X.[133X
  
  [33X[0;0YThe  following  conversions  are  performed  by [10Xjulia_gap[110X (from [5XGAP[105X's [10XObj[110X to
  [5XJulia[105X's [10Xjl_value_t*[110X).[133X
  
  [30X    [33X[0;6Y[10XNULL[110X to [10Xjl_nothing[110X,[133X
  
  [30X    [33X[0;6Yimmediate integer to [10XInt64[110X,[133X
  
  [30X    [33X[0;6Yimmediate FFE to the [10XFFE[110X [5XJulia[105X type,[133X
  
  [30X    [33X[0;6Y[5XGAP[105X [9Xtrue[109X to [5XJulia[105X [10Xtrue[110X,[133X
  
  [30X    [33X[0;6Y[5XGAP[105X [9Xfalse[109X to [5XJulia[105X [10Xfalse[110X,[133X
  
  [30X    [33X[0;6Y[5XJulia[105X object wrapper to [5XJulia[105X object,[133X
  
  [30X    [33X[0;6Y[5XJulia[105X function wrapper to [5XJulia[105X function,[133X
  
  [30X    [33X[0;6Yother [5XGAP[105X objects to [10XGapObj[110X.[133X
  
  [33X[0;0YThe   following   conversions  are  performed  by  [10Xgap_julia[110X  (from  [5XJulia[105X's
  [10Xjl_value_t*[110X to [5XGAP[105X's [10XObj[110X).[133X
  
  [30X    [33X[0;6Y[10XInt64[110X  to  immediate  integer  when  it fits, otherwise to a [5XGAP[105X large
        integer,[133X
  
  [30X    [33X[0;6Y[10XFFE[110X to immediate FFE,[133X
  
  [30X    [33X[0;6Y[5XJulia[105X [10Xtrue[110X to [5XGAP[105X [9Xtrue[109X,[133X
  
  [30X    [33X[0;6Y[5XJulia[105X [10Xfalse[110X to [5XGAP[105X [9Xfalse[109X,[133X
  
  [30X    [33X[0;6Y[10XGapObj[110X to [10XObj[110X,[133X
  
  [30X    [33X[0;6Yother [5XJulia[105X objects to [5XJulia[105X object wrapper.[133X
  
  
  [1X3.1-3 [33X[0;0YManual (explicit) conversions[133X[101X
  
  [33X[0;0YManual  conversion  in  [5XGAP[105X is done via the functions [2XGAPToJulia[102X ([14X3.2-3[114X) and
  [2XJuliaToGAP[102X ([14X3.2-2[114X).[133X
  
  [33X[0;0Y[13XConversion from [5XGAP[105X to [5XJulia[105X[113X[133X
  
  [33X[0;0YIn [5XGAP[105X, the function [2XGAPToJulia[102X ([14X3.2-3[114X) calls (after automatic conversion of
  the  [5XGAP[105X  object  if applicable) the [5XJulia[105X function [10Xgap_to_julia[110X; If a [5XJulia[105X
  type  has been entered as the first argument of [2XGAPToJulia[102X ([14X3.2-3[114X) then this
  is  the  type  to  which  the  [5XGAP[105X  object shall be converted, and if such a
  conversion  is  implemented  then  a  [5XJulia[105X object of this type is returned,
  otherwise an [10XArgumentError[110X is thrown.[133X
  
  [30X    [33X[0;6Y[10XIsBool[110X to [10XBool[110X,[133X
  
  [30X    [33X[0;6Y[10XIsFFE and IsInternalRep[110X to [10XFFE[110X,[133X
  
  [30X    [33X[0;6Y[10XIsInt  and  IsSmallIntRep[110X  to  [10XInt8[110X,  [10XInt16[110X,  [10XInt32[110X,  [10XInt64[110X (default),
        [10XInt128[110X, [10XUInt8[110X, [10XUInt16[110X, [10XUInt32[110X, [10XUInt64[110X, [10XUInt128[110X, [10XBigInt[110X, or [10XRational{T}
        where T <: Integer[110X,[133X
  
  [30X    [33X[0;6Y[10XGapObj   and  IsInt[110X  to  [10XBigInt[110X  (default),  or  [10XRational{T}  where  T
        <: Integer[110X,[133X
  
  [30X    [33X[0;6Y[10XGapObj and IsRat[110X to [10XRational{BigInt}[110X (default), or [10XRational{T} where T
        <: Integer[110X,[133X
  
  [30X    [33X[0;6Y[10XIsFloat[110X to [10XFloat16[110X, [10XFloat32[110X, [10XFloat64[110X (default), or [10XBigFloat[110X,[133X
  
  [30X    [33X[0;6Y[10XIsChar[110X to [10XCuchar[110X,[133X
  
  [30X    [33X[0;6Y[10XIsString[110X  to  [10XAbstractString[110X (default), [10XString[110X, [10XSymbol[110X, [10XVector{UInt8}[110X,
        or types available for [10XIsList[110X,[133X
  
  [30X    [33X[0;6Y[10XIsRange[110X   to   [10XStepRange{Int64,Int64}[110X   (default),   [10XStepRange{T1,T2}[110X,
        [10XUnitRange{T}[110X, or types available for [10XIsList[110X,[133X
  
  [30X    [33X[0;6Y[10XIsBlist[110X to [10XBitVector[110X (default), or types available for [10XIsList[110X,[133X
  
  [30X    [33X[0;6Y[10XIsList[110X  to [10XVector{Union{Any,Nothing}}[110X (default), [10XVector{T}[110X, [10XMatrix{T}[110X,
        or [10XT <: Tuple[110X,[133X
  
  [30X    [33X[0;6Y[10XIsRecord[110X to [10XDict{Symbol,Any}[110X (default) or [10XDict{Symbol,T}[110X.[133X
  
  [33X[0;0YIf  no  [5XJulia[105X  type  is  specified then a [5XJulia[105X type is chosen, based on the
  filters of the [5XGAP[105X object, see the [21X(default)[121X markers in the above list. Note
  that  this might include checking various filters and will be, in almost all
  cases, slower than the typed version.[133X
  
  [33X[0;0Y[13XConversion from [5XJulia[105X to [5XGAP[105X[113X[133X
  
  [33X[0;0YThere  are  two  alternatives  for  this  direction,  the  Julia constructor
  [2XGAP_jl.Obj[102X ([14X3.2-1[114X) and the [5XGAP[105X constructor [2XJuliaToGAP[102X ([14X3.2-2[114X).[133X
  
  [33X[0;0Y[2XGAP_jl.Obj[102X  ([14X3.2-1[114X) is a [5XJulia[105X function that takes one or two arguments, the
  object  to  be  converted and optionally the value [9Xtrue[109X indicating recursive
  conversion of nested objects. The chosen method depends on the [5XJulia[105X type of
  the first argument.[133X
  
  [33X[0;0YThe  function [2XJuliaToGAP[102X ([14X3.2-2[114X). takes two or three arguments, a [5XGAP[105X filter
  and  an  object  to  be  converted, and optionally the value [9Xtrue[109X indicating
  recursive conversion of nested objects. Various methods for this constructor
  then  take  care  of  input  validation and the actual conversion, either by
  delegating  to  the  [5XJulia[105X  function  [10XGapObj[110X  (which  takes  just one or two
  arguments  and  chooses the [5XGAP[105X filters of its result depending on the [5XJulia[105X
  type), or by automatic conversion.[133X
  
  [33X[0;0YThe  supported  [5XJulia[105X types of the second argument of [2XJuliaToGAP[102X ([14X3.2-2[114X) are
  as follows; more [5XJulia[105X types may be supported for [2XGAP_jl.Obj[102X ([14X3.2-1[114X).[133X
  
      ┌──────────────────────────────────┬────────────┬──────────────────────┐
      │ [5XJulia[105X type                       │ [5XGAP[105X filter │ comment              │ 
      ├──────────────────────────────────┼────────────┼──────────────────────┤
      │ [10XInt64[110X, [10XGapObj[110X, [10XFFE[110X, and [10XBool[110X     │            │ automatic conversion │ 
      │ other integers, including [10XBigInt[110X │ [10XIsInt[110X      │ integers             │ 
      │ [10XRational{T}[110X                      │ [10XIsRat[110X      │ rationals            │ 
      │ [10XFloat16[110X, [10XFloat32[110X, [10XFloat64[110X        │ [10XIsFloat[110X    │ machine floats       │ 
      │ [10XAbstractString[110X                   │ [10XIsString[110X   │ strings              │ 
      │ [10XSymbol[110X                           │ [10XIsString[110X   │ strings              │ 
      │ [10XVector{T}[110X                        │ [10XIsList[110X     │ plain lists          │ 
      │ [10XVector{Bool}[110X, [10XBitVector[110X          │ [10XIsBList[110X    │ bit lists            │ 
      │ [10XTuple{T}[110X                         │ [10XIsList[110X     │ plain lists          │ 
      │ [10XDict{String,T}[110X, [10XDict{Symbol,T}[110X   │ [10XIsRecord[110X   │ records              │ 
      │ [10XUnitRange{T}[110X, [10XStepRange{T}[110X       │ [10XIsRange[110X    │ ranges               │ 
      └──────────────────────────────────┴────────────┴──────────────────────┘
  
  
  [1X3.2 [33X[0;0YConversion functions[133X[101X
  
  [1X3.2-1 GAP_jl.Obj[101X
  
  [33X[1;0Y[29X[2XGAP_jl.Obj[102X( [3Xjuliaobj[103X[, [3Xrecursive[103X] ) [32X function[133X
  [33X[1;0Y[29X[2XGAP_jl.GapObj[102X( [3Xjuliaobj[103X[, [3Xrecursive[103X] ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5XGAP[105X object[133X
  
  [33X[0;0YThe  [5XJulia[105X  constructor  [2XGAP_jl.Obj[102X  takes  an object [3Xjuliaobj[103X and chooses a
  method  depending on its [5XJulia[105X type for computing a [5XGAP[105X object corresponding
  to  [3Xjuliaobj[103X.  If  [3Xrecursive[103X  is  [9Xtrue[109X  then  nested  objects  are converted
  recursively.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XGAP_jl.Obj( 42 );[127X[104X
    [4X[28X42[128X[104X
    [4X[25Xgap>[125X [27Xm:= GAPToJulia( [ [ 1, 2 ], [ 3, 4 ] ] );[127X[104X
    [4X[28X<Julia: Any[Any[1, 2], Any[3, 4]]>[128X[104X
    [4X[25Xgap>[125X [27XGAP_jl.Obj( m );[127X[104X
    [4X[28X[ <Julia: Any[1, 2]>, <Julia: Any[3, 4]> ][128X[104X
    [4X[25Xgap>[125X [27XGAP_jl.Obj( m, true );[127X[104X
    [4X[28X[ [ 1, 2 ], [ 3, 4 ] ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YOne  advantage  of  [2XGAP_jl.Obj[102X  compared  to  the [5XGAP[105X constructor [2XJuliaToGAP[102X
  ([14X3.2-2[114X)  is  that  it is easy to extend the scope of [2XGAP_jl.Obj[102X on the [5XJulia[105X
  side,  whereas  extending  [2XJuliaToGAP[102X  ([14X3.2-2[114X)  would  require  changing its
  methods.  For example, the [5XOscar[105X system provides [5XJulia[105X types of matrices for
  which  conversions  to  [5XGAP[105X matrices are installed, via suitable methods for
  [2XGAP_jl.Obj[102X.[133X
  
  [33X[0;0YIf  one is sure that the result of the conversion to [5XGAP[105X is not an immediate
  [5XGAP[105X object then one can call [2XGAP_jl.GapObj[102X instead of [2XGAP_jl.Obj[102X.[133X
  
  [1X3.2-2 JuliaToGAP[101X
  
  [33X[1;0Y[29X[2XJuliaToGAP[102X( [3Xfilt[103X, [3Xjuliaobj[103X[, [3Xrecursive[103X] ) [32X constructor[133X
  [6XReturns:[106X  [33X[0;10Ya [5XGAP[105X object in the filter [3Xfilt[103X[133X
  
  [33X[0;0YLet [3Xjuliaobj[103X be a Julia object in for which a conversion to [5XGAP[105X is provided,
  in  the  sense  of Section [14X3.1[114X, such that the corresponding [5XGAP[105X object is in
  the filter [3Xfilt[103X. Then [2XJuliaToGAP[102X returns this [5XGAP[105X object.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:= GAPToJulia( "abc" );[127X[104X
    [4X[28X<Julia: "abc">[128X[104X
    [4X[25Xgap>[125X [27XJuliaToGAP( IsString, s );[127X[104X
    [4X[28X"abc"[128X[104X
    [4X[25Xgap>[125X [27Xl:= GAPToJulia( [ 1, 2, 4 ] );[127X[104X
    [4X[28X<Julia: Any[1, 2, 4]>[128X[104X
    [4X[25Xgap>[125X [27XJuliaToGAP( IsList, l );[127X[104X
    [4X[28X[ 1, 2, 4 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YFor  recursive  structures ([5XGAP[105X lists and records), only the outermost level
  is  converted except if the optional argument [3Xrecursive[103X is given and has the
  value [9Xtrue[109X, in this case all layers are converted recursively.[133X
  
  [33X[0;0YNote  that this default is different from the default in the other direction
  (see  [2XGAPToJulia[102X  ([14X3.2-3[114X)).  The  idea  behind  this choice is that from the
  viewpoint of a [5XGAP[105X session, it is more likely to use plain [5XJulia[105X objects for
  computations  on  the  [5XJulia[105X  side  than  [5XJulia[105X  objects  that  contain  [5XGAP[105X
  subobjects,  whereas  [21Xshallow  conversion[121X  of  [5XJulia[105X  objects  to [5XGAP[105X yields
  something useful on the [5XGAP[105X side.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xm:= GAPToJulia( [ [ 1, 2 ], [ 3, 4 ] ] );[127X[104X
    [4X[28X<Julia: Any[Any[1, 2], Any[3, 4]]>[128X[104X
    [4X[25Xgap>[125X [27XJuliaToGAP( IsList, m );[127X[104X
    [4X[28X[ <Julia: Any[1, 2]>, <Julia: Any[3, 4]> ][128X[104X
    [4X[25Xgap>[125X [27XJuliaToGAP( IsList, m, true );[127X[104X
    [4X[28X[ [ 1, 2 ], [ 3, 4 ] ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe following values for [3Xfilt[103X are supported. [2XIsInt[102X ([14XReference: IsInt[114X), [2XIsRat[102X
  ([14XReference:  IsRat[114X),  [2XIsFFE[102X  ([14XReference:  IsFFE[114X),  [10XIsFloat[110X  (see [14X'Reference:
  Floats'[114X),  [2XIsBool[102X  ([14XReference: IsBool[114X), [2XIsChar[102X ([14XReference: IsChar[114X), [2XIsRecord[102X
  ([14XReference:  IsRecord[114X),  [2XIsString[102X ([14XReference: IsString[114X), [2XIsRange[102X ([14XReference:
  IsRange[114X),  [2XIsBlist[102X  ([14XReference:  IsBlist[114X),  [2XIsList[102X  ([14XReference: IsList[114X). See
  Section [14X3.1[114X for the admissible types of [3Xjuliaobj[103X in these cases.[133X
  
  [1X3.2-3 GAPToJulia[101X
  
  [33X[1;0Y[29X[2XGAPToJulia[102X( [[3Xjuliatype[103X, ][3Xgapobj[103X[, [3Xrecursive[103X] ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5XJulia[105X object[133X
  
  [33X[0;0YLet  [3Xgapobj[103X be an object for which a conversion to [5XJulia[105X is provided, in the
  sense  of  Section  [14X3.1[114X,  such  that  a corresponding [5XJulia[105X object with type
  [3Xjuliatype[103X can be constructed. Then [2XGAPToJulia[102X returns this [5XJulia[105X object.[133X
  
  [33X[0;0YIf  [3Xjuliatype[103X  is  not  given then a default type is chosen. The function is
  implemented via the [5XJulia[105X function [10XGAP.gap_to_julia[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( 1 );[127X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( JuliaType( Julia.Rational, [ Julia.Int64 ] ), 1 );[127X[104X
    [4X[28X<Julia: 1//1>[128X[104X
    [4X[25Xgap>[125X [27Xl:= [ 1, 3, 4 ];;[127X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( l );[127X[104X
    [4X[28X<Julia: Any[1, 3, 4]>[128X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( JuliaType( Julia.Vector, [ Julia.Int ] ), l );[127X[104X
    [4X[28X<Julia: [1, 3, 4]>[128X[104X
    [4X[25Xgap>[125X [27Xm:= [ [ 1, 2 ], [ 3, 4 ] ];;[127X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( m );[127X[104X
    [4X[28X<Julia: Any[Any[1, 2], Any[3, 4]]>[128X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( JuliaType( Julia.Matrix, [ Julia.Int ] ), m );[127X[104X
    [4X[28X<Julia: [1 2; 3 4]>[128X[104X
    [4X[25Xgap>[125X [27Xr:= rec( a:= 1, b:= [ 1, 2, 3 ] );;[127X[104X
    [4X[25Xgap>[125X [27XGAPToJulia( r );[127X[104X
    [4X[28X<Julia: Dict{Symbol,Any}(:a => 1,:b => Any[1, 2, 3])>[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIf  [3Xgapobj[103X  is a list or a record, one may want that its subobjects are also
  converted  to  [5XJulia[105X or that they are kept as they are, which can be decided
  by  entering  [9Xtrue[109X or [9Xfalse[109X as the value of the optional argument [3Xrecursive[103X;
  the  default  is  [9Xtrue[109X,  that  is,  the  subobjects  of [3Xgapobj[103X are converted
  recursively.[133X
  
  [33X[0;0YNote that this default is different from the default in the other direction,
  see the description of [2XJuliaToGAP[102X ([14X3.2-2[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xjl:= GAPToJulia( m, false );[127X[104X
    [4X[28X<Julia: Any[GAP: [ 1, 2 ], GAP: [ 3, 4 ]]>[128X[104X
    [4X[25Xgap>[125X [27Xjl[1];[127X[104X
    [4X[28X[ 1, 2 ][128X[104X
    [4X[25Xgap>[125X [27Xjr:= GAPToJulia( r, false );[127X[104X
    [4X[28X<Julia: Dict{Symbol,Any}(:a => 1,:b => GAP: [ 1, 2, 3 ])>[128X[104X
    [4X[25Xgap>[125X [27XJulia.Base.get( jr, Julia.Symbol( "b" ), fail );[127X[104X
    [4X[28X[ 1, 2, 3 ][128X[104X
  [4X[32X[104X
  
  
  [1X3.3 [33X[0;0YUsing [5XJulia[105X[101X[1X random number generators in [5XGAP[105X[101X[1X[133X[101X
  
  [1X3.3-1 IsRandomSourceJulia[101X
  
  [33X[1;0Y[29X[2XIsRandomSourceJulia[102X( [3Xobj[103X ) [32X Category[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YThis  filter  allows one to use [5XJulia[105X's random number generators in [5XGAP[105X, see
  [14X'Reference:   Random  Sources'[114X  for  the  background.  Calling  [2XRandomSource[102X
  ([14XReference:  RandomSource[114X)  with  only argument [2XIsRandomSourceJulia[102X yields a
  [5XGAP[105X  random  source  that  uses  a  copy  of  [5XJulia[105X's  default random number
  generator [10XRandom.default_rng()[110X. Note that different calls with only argument
  [2XIsRandomSourceJulia[102X yield different random sources.[133X
  
  [33X[0;0YCalled   with  [2XIsRandomSourceJulia[102X  and  a  positive  integer,  [2XRandomSource[102X
  ([14XReference: RandomSource[114X) returns a random source that is based on a copy of
  [10XRandom.default_rng()[110X but got initialized with the given integer as a seed.[133X
  
  [33X[0;0YCalled  with  [2XIsRandomSourceJulia[102X  and  a  [5XJulia[105X  random  number  generator,
  [2XRandomSource[102X  ([14XReference:  RandomSource[114X)  returns  a random source that uses
  this  random number generator. Note that we do [13Xnot[113X make a copy of the second
  argument,  in order to be able to use the given random number generator both
  on the [5XGAP[105X side and the [5XJulia[105X side.[133X
  
  [33X[0;0Y[2XState[102X ([14XReference: State[114X) for random sources in [2XIsRandomSourceJulia[102X returns a
  copy of the underlying [5XJulia[105X random number generator.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xrs1:= RandomSource( IsRandomSourceJulia );[127X[104X
    [4X[28X<RandomSource in IsRandomSourceJulia>[128X[104X
    [4X[25Xgap>[125X [27Xrs2:= RandomSource( IsRandomSourceJulia,[127X[104X
    [4X[25X>[125X [27X                       GAP_jl.Random.default_rng() );[127X[104X
    [4X[28X<RandomSource in IsRandomSourceJulia>[128X[104X
    [4X[25Xgap>[125X [27Xrepeat[127X[104X
    [4X[25X>[125X [27X  x:= Random( rs1, [ 1 .. 100 ] );[127X[104X
    [4X[25X>[125X [27X  y:= Random( rs2, [ 1 .. 100 ] );[127X[104X
    [4X[25X>[125X [27Xuntil x <> y;[127X[104X
    [4X[25Xgap>[125X [27XRandom( rs1, 1, 100 ) in [ 1 .. 100 ];[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xfrom:= 2^70;;  to:= from + 100;;[127X[104X
    [4X[25Xgap>[125X [27Xx:= Random( rs1, from, to );;[127X[104X
    [4X[25Xgap>[125X [27Xfrom <= x and x <= to;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xg:= SymmetricGroup( 10 );;[127X[104X
    [4X[25Xgap>[125X [27XRandom( rs1, g ) in g;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XState( rs1 ) = JuliaPointer( rs1 );[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X3.4 [33X[0;0YOpen items[133X[101X
  
  [30X    [33X[0;6YDiscuss/add more dedicated conversion functions and/or special wrapper
        kinds, e.g.:[133X
  
        [30X    [33X[0;12YThere  could be a [5XJulia[105X type hierarchy of wrappers, e.g., [10XGAPInt
              <:  GAPRat  <:  GAPCyc[110X; those types would wrap the corresponding
              [5XGAP[105X objects, i.e., they would simply wrap a [10XUnion{GapObj,Int64}[110X,
              but  perhaps  provided nicer integration with the rest of [5XJulia[105X,
              like  methods  for [10Xgcd[110X, say, which are properly type restricted;
              or  nicer  printing (w/o the [10XGAP:[110X prefix even?). Not really sure
              whether this is useful, though.[133X
  
  [30X    [33X[0;6YShould  we  allow the three argument case of [2XJuliaToGAP[102X ([14X3.2-2[114X) in all
        cases, e.g., [10XJuliaToGAP( IsInt, 1, true )[110X?[133X
  
  [30X    [33X[0;6YMany tests of conversions are missing.[133X
  
