| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
26.1.6.6 C functions
C function types are introduced by the <function-type> clause:
<function-type> →(function<ident>(<ident>*))
Let us suppose the array type declaration:
(type fun (function res (arg*)) ...)
Bigloo creates the following functions:
- A type checker:
(fun?::bool obj::obj)
This function returns
#tif the argument obj is of type fun and#fotherwise. - An equality checker:
(=fun*?::bool ::fun* ::fun*)
This function returns
#tif and only if its arguments are equal. - Caller:
(fun-call::res f::fun a::ta ...)
This function invokes f with the arguments a … an.
Suppose we have to use in Scheme the following C variable:
double (*convert)(char *);
It can be done as in:
(module foo
(extern
(type *string->double
(function double (string))
"double (*)(char *)")
(macro cv::*string->double "convert")))
(print (*string->double-call cv "3.14"))
This document was generated on October 23, 2011 using texi2html 5.0.
