English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Deconstructing optional arguments
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-11 (09:58)
From: Jon Harrop <jon@f...>
Subject: Deconstructing optional arguments

Is it possible to deconstruct an optional argument as you can with a labeled 
argument:

  let f ~p:(x,y) () = x - y

with something like:

  let f ?(p=0,0):(x,y) () = x - y

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e