Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /ecldev.xmlf [d0e0b7] .. [5d2657] Maximize Restore

  Switch to unified view

a/ecldev.xmlf b/ecldev.xmlf
...
...
453
   <blockquote>
453
   <blockquote>
454
    <screen><indexterm role="tp"><primary>cl_object</primary></indexterm>&#151; C type: <structname>cl_object</structname></screen>
454
    <screen><indexterm role="tp"><primary>cl_object</primary></indexterm>&#151; C type: <structname>cl_object</structname></screen>
455
    <para>This is the type of a lisp object. For your C/C++ program, a <literal>cl_object</literal>
455
    <para>This is the type of a lisp object. For your C/C++ program, a <literal>cl_object</literal>
456
     can be either a fixnum, a character, or a pointer to a union of structures (See
456
     can be either a fixnum, a character, or a pointer to a union of structures (See
457
     the header <filename>object.h</filename>). The actual interpretation of that object can be
457
     the header <filename>object.h</filename>). The actual interpretation of that object can be
458
     guessed with the macro <literal>type_of</literal>.</para>
458
     guessed with the macro <literal>ecl_t_of</literal>.</para>
459
    <para>For example, if <replaceable>x</replaceable> is of type <literal>cl_object</literal>, and it is of type fixnum,
459
    <para>For example, if <replaceable>x</replaceable> is of type <literal>cl_object</literal>, and it is of type fixnum,
460
     we may retrieve its value</para>
460
     we may retrieve its value</para>
461
    <screen>
461
    <screen>
462
     if (type_of(x) == t_fixnum)
462
     if (ecl_t_of(x) == t_fixnum)
463
     printf("Integer value: %d\n", fix(x));
463
     printf("Integer value: %d\n", fix(x));
464
    </screen>
464
    </screen>
465
    <para role="continues">If <replaceable>x</replaceable> is of type <literal>cl_object</literal> and it does not contain an immediate
465
    <para role="continues">If <replaceable>x</replaceable> is of type <literal>cl_object</literal> and it does not contain an immediate
466
     datatype, you may inspect the cell associated to the lisp object using <replaceable>x</replaceable>
466
     datatype, you may inspect the cell associated to the lisp object using <replaceable>x</replaceable>
467
     as a pointer. For example,</para>
467
     as a pointer. For example,</para>
468
    <screen>
468
    <screen>
469
     if (type_of(x) == t_cons)
469
     if (ecl_t_of(x) == t_cons)
470
     printf("CAR = %x, CDR = %x\n", x-&gt;cons.car, x-&gt;cons.cdr);
470
     printf("CAR = %x, CDR = %x\n", x-&gt;cons.car, x-&gt;cons.cdr);
471
     else if (type_of(x) == t_string)
471
     else if (ecl_t_of(x) == t_string)
472
     printf("String: %s\n", x-&gt;string.self);
472
     printf("String: %s\n", x-&gt;string.self);
473
    </screen>
473
    </screen>
474
    <para role="continues">You should see the following sections and the header <filename>object.h</filename> to learn
474
    <para role="continues">You should see the following sections and the header <filename>object.h</filename> to learn
475
     how to use the different fields of a <literal>cl_object</literal> pointer.</para>
475
     how to use the different fields of a <literal>cl_object</literal> pointer.</para>
476
   </blockquote>
476
   </blockquote>
...
...
482
     t_array, t_vector, t_string, t_bitvector, t_stream, t_random, t_readtable,
482
     t_array, t_vector, t_string, t_bitvector, t_stream, t_random, t_readtable,
483
     t_pathname, t_bytecodes, t_cfun, t_cclosure, t_gfun, t_instance, t_foreign and
483
     t_pathname, t_bytecodes, t_cfun, t_cclosure, t_gfun, t_instance, t_foreign and
484
     t_thread.</para>
484
     t_thread.</para>
485
   </blockquote>
485
   </blockquote>
486
   <blockquote>
486
   <blockquote>
487
    <screen><indexterm role="fn"><primary>type_of</primary></indexterm>&#151; Function: <returnvalue>cl_type</returnvalue> <function>type_of</function> (<type>cl_object</type> <varname>O</varname>)</screen>
487
    <screen><indexterm role="fn"><primary>ecl_t_of</primary></indexterm>&#151; Function: <returnvalue>cl_type</returnvalue> <function>ecl_t_of</function> (<type>cl_object</type> <varname>O</varname>)</screen>
488
    <para>If <replaceable>O</replaceable> is a valid lisp object, <literal>type_of(<replaceable>O</replaceable>)</literal> returns an integer
488
    <para>If <replaceable>O</replaceable> is a valid lisp object, <literal>ecl_t_of(<replaceable>O</replaceable>)</literal> returns an integer
489
     denoting the type that lisp object. That integer is one of the values of the
489
     denoting the type that lisp object. That integer is one of the values of the
490
     enumeration type <literal>cl_type</literal>.</para>
490
     enumeration type <literal>cl_type</literal>.</para>
491
   </blockquote>
491
   </blockquote>
492
   <blockquote>
492
   <blockquote>
493
    <screen><indexterm role="fn"><primary>FIXNUMP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>FIXNUMP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
493
    <screen><indexterm role="fn"><primary>FIXNUMP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>FIXNUMP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
...
...
498
    <screen><indexterm role="fn"><primary>ARRAYP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>ARRAYP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
498
    <screen><indexterm role="fn"><primary>ARRAYP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>ARRAYP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
499
    <screen><indexterm role="fn"><primary>VECTORP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>VECTORP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
499
    <screen><indexterm role="fn"><primary>VECTORP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>VECTORP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
500
    <screen><indexterm role="fn"><primary>STRINGP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>STRINGP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
500
    <screen><indexterm role="fn"><primary>STRINGP</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>STRINGP</function> (<type>cl_object</type> <varname>o</varname>)</screen>
501
    <para>Different macros that check whether <replaceable>o</replaceable> belongs to the specified type.
501
    <para>Different macros that check whether <replaceable>o</replaceable> belongs to the specified type.
502
     These checks have been optimized, and are preferred over several calls to
502
     These checks have been optimized, and are preferred over several calls to
503
     <literal>type_of</literal>.</para>
503
     <literal>ecl_t_of</literal>.</para>
504
   </blockquote>
504
   </blockquote>
505
   <blockquote>
505
   <blockquote>
506
    <screen><indexterm role="fn"><primary>IMMEDIATE</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>IMMEDIATE</function> (<type>cl_object</type> <varname>o</varname>)</screen>
506
    <screen><indexterm role="fn"><primary>IMMEDIATE</primary></indexterm>&#151; Function: <returnvalue>bool</returnvalue> <function>IMMEDIATE</function> (<type>cl_object</type> <varname>o</varname>)</screen>
507
    <para>Tells whether <replaceable>o</replaceable> is an immediate datatype.</para>
507
    <para>Tells whether <replaceable>o</replaceable> is an immediate datatype.</para>
508
   </blockquote>
508
   </blockquote>