Version française
Home     About     Download     Resources     Contact us    
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?
Hello,

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...)

Regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl