Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] naming parts of optional arguments?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Max Kirillov <max630@m...>
Subject: Re: [Caml-list] naming parts of optional arguments?
On Thu, Mar 27, 2003 at 05:05:17PM -0800, Chris Hecker wrote:
> 
> Is there a way to name the components of an optional argument?

# let f ?xy:((x,y)=0,0) () = x+y;; 
val f : ?xy:int * int -> unit -> int = <fun>
# f ();;                           
- : int = 0
# f ~xy:(1,2) ();;
- : int = 3

-- 
Max

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners