OCaml を使用したアプリケーションの開発のこのdraw_string_in_box の例に従っています
与えられたサンプルコードは次のとおりです。
let draw_string_in_box pos str bcf col =
let (w, h) = Graphics.text_size str in
let ty = bcf.y + (bcf.h-h)/2 in
( match pos with
Center -> Graphics.moveto (bcf.x + (bcf.w-w)/2) ty
| Right -> let tx = bcf.x + bcf.w - w - bcf.bw - 1 in
Graphics.moveto tx ty
| Left -> let tx = bcf.x + bcf.bw + 1 in Graphics.moveto tx ty );
Graphics.set_color col;
Graphics.draw_string str;;
「一致」部分の括弧を削除すると、コードは機能しません (何も出力されません)。理由はありますか?
より一般的には、このようなコード ビットをいつ括弧で囲む必要がありますか?
ありがとう。