From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0L6Cp0l029646 for ; Fri, 21 Jan 2011 07:12:51 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtMAADOzOE3RVdW0k2dsb2JhbACEE5I0jhQIFQEBAQEJCQoJEQQgpD2JPzyCF4RTLohYAQEDBYEfgzh0BIsf X-IronPort-AV: E=Sophos;i="4.60,356,1291590000"; d="scan'208";a="96156292" Received: from mail-yx0-f180.google.com ([209.85.213.180]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 21 Jan 2011 07:12:28 +0100 Received: by yxd30 with SMTP id 30so49835yxd.39 for ; Thu, 20 Jan 2011 22:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=fMvX0W7l1br3UXoMMl5YtcprZE2i/Iho5XoZQWL4yHE=; b=XYpmDx3lUIeRPEMFbWgJ+NUrOQPEbe85bg9HNDlUuTDC8kfoZ61YTNUmqSSudopNV9 77ZVuXQBedLiarDKj1xVTxiG1yjVnOI6S9VPWQNhuChHLtMkVzxzC2MTEStdElV5eCGT jKeN4HOWdCM36nkQ4oS2VLE/4KuLQb8Ms8LVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DMlBGZa8EFCnXoPPAohzRRQ9O8TXO3hMz7RRdE6QLvJuDQNZWvZE/jHwkOahYWYF1C 5MQ7dLCK7yGN6K8ZYvOesnku8gFZeNhjoUmISocYTVvFQewk7xE30dW4se38nBFK0WNX jF2zSqkLp8FPcPsWd4mp38yeVjbQJRCMvWY5s= MIME-Version: 1.0 Received: by 10.151.15.15 with SMTP id s15mr253450ybi.357.1295590346093; Thu, 20 Jan 2011 22:12:26 -0800 (PST) Received: by 10.151.157.5 with HTTP; Thu, 20 Jan 2011 22:12:26 -0800 (PST) In-Reply-To: References: <4D391C4A.9000608@riken.jp> Date: Fri, 21 Jan 2011 08:12:26 +0200 Message-ID: From: dmitry grebeniuk To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] writing some code using a function for which only the signature is known Hello. (sorry for dupe, I've sent first message privately, not in mailing list; and I've fixed some code here.) > 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 _myparam1 _myparam2 = 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).