Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
"catch-all" labels?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <mottl@m...>
Subject: "catch-all" labels?

in some function applications labels seem to be somewhat more clumsy than
their unlabeled version, e.g.:

  # List.fold_left fun:(+) acc:0 [1;2;3];;
  This expression has type int -> int -> int but is here used with type
    acc:'a -> 'b -> 'a

Would it make sense to introduce something like "catch-all" labels, which
might be useful in functions like "+" where the order of parameters does
not matter, maybe:

  let (+) _:x _:y = x + y

which would match any label? (Only curious...)

Markus Mottl

Markus Mottl,,