Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
OCaml 標準ライブラリの多くのexternal宣言には、関数名の先頭に % があります。たとえば、次のように定義されていますint_of_float。
external
int_of_float
external int_of_float : float -> int = "%intoffloat"
「%」は何を意味しますか?
% を含む external は特別な外部であり、コンパイラによって特別に処理されます。たとえば、int_of_float を使用すると、ocamlc はそれを何らかの C 関数の呼び出しにコンパイルしますが、ocamlopt を使用すると、double を整数に変換する特別なアセンブラー オペコードにコンパイルします。