SML# - Language/FFI/Import Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

The following special form converts a C function pointer to SML# function.
exp : _import (ty1, ..., tyn) -> ty
* ''exp'' is a C pointer expression of type ''unit ptr'' obtained by DynamicLink.dlsym,
* ''(ty1, ..., tyn)'' specifies the types of the arguments. The number and the types must agree with those of C function specification.
* ''ty'' is the type of return value.
This is a shorthand for the following more primitive [[_ffiapply special form|Language/FFI/Ffiapply]]:
fn (x1,...,xn) => _ffiapply exp (x1:ty1, ..., xn:tyn) : ty