From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0L8Pekw001722 for ; Fri, 21 Jan 2011 09:25:40 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AigEACPSOE2GoCGihWdsb2JhbACEE5I1jjEBAQEKCwoFEyStHJAugSSDOHQEhG2GMg X-IronPort-AV: E=Sophos;i="4.60,357,1291590000"; d="scan'208";a="87637233" Received: from postman2.riken.jp (HELO postman.riken.jp) ([134.160.33.162]) by mail2-smtp-roc.national.inria.fr with ESMTP; 21 Jan 2011 09:25:34 +0100 Received: from postman.riken.jp (postman2.riken.jp [127.0.0.1]) by postman.riken.jp (Postfix) with SMTP id D8DD0126025B for ; Fri, 21 Jan 2011 17:25:31 +0900 (JST) Received: from watson.ad98.riken.jp (rikad98.riken.jp [134.160.214.98]) by postman.riken.jp (Postfix) with ESMTPA id C0CC91270063 for ; Fri, 21 Jan 2011 17:25:31 +0900 (JST) Message-ID: <4D3942FB.8020604@riken.jp> Date: Fri, 21 Jan 2011 17:25:31 +0900 From: Francois Berenger User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.1.21.62115 Subject: [Fwd: Re: [Caml-list] writing some code using a function for which only the signature is known] -------- Original Message -------- Subject: Re: [Caml-list] writing some code using a function for which only the signature is known Date: Fri, 21 Jan 2011 08:05:57 +0200 From: dmitry grebeniuk To: Francois Berenger Hello. > If I am writing some code, and I don't want to dive > into implementing some sub function I will need but don't > have yet, what is the standard way to do this in ocaml? I don't know any standart way, but I'm using "raise Exit" for this purpose. Or you can use exception that carry function's name, like this: exception Not_implemented of string let notimpl funcname = raise (Not_implemented funcname) let myfunc = notimpl "myfunc" And there are some cases when you need to specify the type of function (either "you need", or "it will ease your life substantially"), even if the function is not implemented. Moreover, it's better to describe arguments of such function (to document the code, to add type constraints, to ease implementation of the function later (either full or partial)): let process_them _len _contents _on_finish = raise Exit Notice the first underscores in arguments' names: they are here to suppress warnings about unused bindings (really, these bindings are unused in this function).