| |
fa.caml |
> The section 6.6 of OCaml's manual introduces a notion of "Parenthesized > I couldn't find any examples on how to use this feature, and brute-force > # match 1.0 with > Could anyone point at a suitable resource? match ((1.0 : float) : string) with In OCaml, match-with is a test against the structure of a value, not its Martin -- _______________________________________________
> Hi,
> patterns".
> approach doesn't work:
> (y : float) -> print_float y
> | (s : string) -> print_string s;;
> This pattern matches values of type string
> but is here used to match values of type float
> #
y -> print_float y
| s -> print_string s
type. What you want to do is not currently possible in OCaml.
Martin Jambon, PhD
http://martin.jambon.free.fr
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs