[plt-scheme] _double and _double*

From: Chihiro Kuraya (rxqvw at yahoo.co.jp)
Date: Wed Jun 8 07:47:33 EDT 2005

Hi,

I have a question about differences between _double and _double* ctypes.

In "PLT Foreign Interface Manual", Section 2.2.1 says as follows:

  Finally, there are two floating point types, _float and _double 
  for the corresponding C types; and _double* that implicitly 
  coerces any non-complex number to a C double.

I looked source code for implementation of above.
I found the followings in foreign.c .

  t = (ctype_struct*)scheme_malloc_tagged(sizeof(ctype_struct));
  t->so.type = ctype_tag;
  t->basetype = (NULL);
  t->scheme_to_c = ((Scheme_Object*)(void*)(&ffi_type_double));
  t->c_to_scheme = ((Scheme_Object*)FOREIGN_double);
  scheme_add_global("_double", (Scheme_Object*)t, menv);

  t = (ctype_struct*)scheme_malloc_tagged(sizeof(ctype_struct));
  t->so.type = ctype_tag;
  t->basetype = (NULL);
  t->scheme_to_c = ((Scheme_Object*)(void*)(&ffi_type_double));
  t->c_to_scheme = ((Scheme_Object*)FOREIGN_doubleS);
  scheme_add_global("_double*", (Scheme_Object*)t, menv);

It seems that Scheme to C conversion is the same 
between _double and _double* .  

Is the document wrong ?
Or are there any my mistakes ?


Chihiro Kuraya
__________________________________
Save the earth
http://pr.mail.yahoo.co.jp/ondanka/



Posted on the users mailing list.