coerceRValueCode    package:RGtkBindingGenerator    R Documentation

_G_e_n_e_r_a_t_e _R _c_o_d_e _t_o _c_o_e_r_c_e _R _o_b_j_e_c_t _t_o _t_y_p_e.

_D_e_s_c_r_i_p_t_i_o_n:

     This generates R code which checks and potentially coerces an
     argument to an S function to the appropriate type as required by C
     code to which the argument will be passed.

_U_s_a_g_e:

     coerceRValueCode(type, name, defs)
     getPrimitiveTypeAs(x)

_A_r_g_u_m_e_n_t_s:

    type: the target type to which the variable 'name' is to be
          converted.

    name: the name of the S variable to be used in the generated
          converstion code

    defs: the collection of class, enumeration, etc. definitions
          collected from the .defs files in which to find information
          about the types. 

       x: the name of the primitive S type. This is then used to index
          the table 'PrimitveTypeCoercion'  by name.

_D_e_t_a_i_l_s:

     This is not extensible, but instead uses a collection of if-else
     statements to determine how to convert the variable to the
     appropriate type. It checks for primitives, enumerations, a string
     array and then punts by assuming 'gtkCheckInherits' will suffice.

_V_a_l_u_e:

     A list giving the name of the variable and the code to coerce it. 

    name: the value of the 'name' argument converted to an S variable
          name using 'nameToS'

  coerce: the string giving the code to convert to the variable to the
          appropriate form.


     'getPrimitiveTypeAs' returns the name of the S function that
     converts the primitive S value to the appropriate type.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/RGtk> <URL:
     http://www.omegahat.org/GtkAutoBindingGen>   <URL:
     http://www.gtk.org>

_S_e_e _A_l_s_o:

     'genCode' 'nameToS'

_E_x_a_m_p_l_e_s:

      data(GtkDefs)
      coerceRValueCode("GtkWidget", "w",  GtkDefs)

