Bridge between Scilab and OCaml

Tu pourrais définir des macros pour raccourcir le code (et éviter les erreurs):

    #define BEGIN_SCILAB_STUB2(name) \
       CAMLprim value name(value ctx_v, value piaddr_v){ \
       CAMLparam2(ctx_v, piaddr_v); \
       CAMLlocal1(ret_v); \
       void *ctx = Abstract_val(ctx_v); \
       void *piaddr = Abstract_val(piaddr_v); \
       
      #define END_SCILAB_STUB CAMLreturn(ret_v); }

et du coup, tu aurais:

    BEGIN_SCILAB_STUB(caml_is_scalar){
    int bool = isScalar( ctx, (int *)piaddr);
    ret_v = Val_boot(bool);
    } END_SCILAB_STUB