2009-07-11から1日間の記事一覧
条件分岐 if 条件 then 式 else 式 条件はbool型 then,elseの式は同じ型の持つ必要がある #if 2 < 1 then 3 else 4 ;; - : int = 4 #if "true" = then 3.14 else 2.72 ;; Error: This expression has type string but is here used with type bool #if "a" =…
条件分岐 if 条件 then 式 else 式 条件はbool型 then,elseの式は同じ型の持つ必要がある #if 2 < 1 then 3 else 4 ;; - : int = 4 #if "true" = then 3.14 else 2.72 ;; Error: This expression has type string but is here used with type bool #if "a" =…