English 中文(简体)
核对C型OCaml型签名
原标题:Checking OCaml type signature from C
  • 时间:2011-08-08 13:28:47
  •  标签:
  • c
  • ocaml

让我说一下,我有奥委会的职能。

let _ = register "cbf_coh_insert" (fun k v -> print_endline ("Inserted key=" ^ k ^ " value=" ^ v))

这项职能有两个论点。 在C方面,我要说,在caml_questback2(*caml_nam(“cbf_coh_insert”),k, v);。 在C方面,是否有办法核实论点数目(在本案中为2项)是否相符? 除我外,我还猜想说它,试图把SIGSEGV锁起来。 感谢!

<>UPDATE: 某些背景

问题回答

NO WAI

在汇编时间时(无论是人工还是代法,还是教令和检查C和OCaml的法典是否属于yn)都应确保这一点。

附录

登记功能:

let on_cbf_coh_insert (f : string -> string -> unit) = register "cbf_coh_insert" f

附录

我希望能够通过一项具有约束力的封闭/完整文件,直接输入C。

你为什么认为不可能这样做? 审视一下所有时间都这样做的现有约束力。

BTW 这个问题是的一个完美例子。 XY problem





相关问题
ocamlc, module compilation

I wrote an app in ocaml. It consist of several modules: Util (util.ml) Work1 (work1.ml) -- open Util Work2 (work2.ml) -- open Util, too Main (main.ml) -- open all of them. When i compile its, using ...

How can I simplify this ocaml pattern-matching code?

I m writing a simple little ocaml program that reads an algebraic statement in from a file, parses it into an AST using ocamllex/ocamlyacc, reduces it, and then prints it. The part where I m reducing ...

How can I create a type with multiple parameters in OCaml?

I m trying to create a type that has multiple type parameters. I know how to make a type with one parameter: type a foo = a * int But I need to have two parameters, so that I can parameterize the ...

Hashtable indexed on several fields

I m currently programming an OCaml module defining a type corresponding to a CPU register. The interface of this module is the following : (* * Defines a type which represents a R3000 register. *) ...

Extending an existing type in OCaml

I ve been doing some OCaml programming lately to learn the language and to get more acquainted with functional programming. Recently, I ve started to think that I d like to be able to extend an ...

Ocaml Syntax Error

What s wrong with this code? I can t figure it out: let parent (rules : grammar) (symbol1 : string) (symbol2 : string) : (SymbolSet.t) = try SymbolSet.singleton (getParent [symbol1; symbol2] ...

热门标签