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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Artem Prisyznuk <tema@s...>
Subject: Re: [Caml-list] optional arguments
On Mon, 17 Nov 2003 11:52:49 +0300, Selentek 24331-03 <epifanov@komset.ru> 
wrote:

> Is there any way to "send optional argument with None value".

f ?v:a ();;


> let a = None;;
> val a : 'a option = None
>
> let f ?v () =
>   match v with
>   | Some i -> i + 1
>   | None   -> 0



-- 
Artem Prysyznuk
tema@sit.kiev.ua

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