Re: nlffi cvt vs get

Vesa Karvonen <vesa.karvonen-bbCR+/[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Quoting brian <briand-/[email protected]>:
> I went back to the "no longer foreign" paper and found the following  
> snippet of example code:
> 
> fun maxx l = let
>    fun x l =
>      C.Cvt.ml_double
>       (C.Get.double
>         (IXDB.S_record.f_x
>           (C.Ptr.|*| l)))
[...]
> The C.Get.double call returns a type which is incompatible with  
> C.Cvt.ml_double

Yes, glancing at the SML/NJ SVN sources, the spec of Cvt.ml_double is

        val ml_double    : double     -> MLRep.Double.real

and Get.double is

        val double    : 'c double_obj     -> MLRep.Double.real

double is an abstract type specified in the C signature

    type [...]    and double

and the C structure is opaquely sealed with the C signature

structure C :> C_INT
(* ... *)
structure C : C = C_Int

thus the type C.double will be a new type.

Apparently parts of NLFFI have changed since the paper was written or the
example in the paper was never compiled.

-Vesa Karvonen

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.