From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 02C08BDC5 for ; Mon, 22 Aug 2005 13:27:05 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j7MBR4xG019394 for ; Mon, 22 Aug 2005 13:27:04 +0200 Received: by rproxy.gmail.com with SMTP id a36so1214062rnf for ; Mon, 22 Aug 2005 04:27:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NWqwAl88kfVoEIsCN/zlvkxBGzcKZvpOJhBkhCIytQtp3UbAGh9CheclB6pAs7gV8PVLP4SjFUdwq3FBZSsZb8XZHpN45RMlvFPHk9tFJtbWIf98o2jsk7QmzLONqjqwBKROeJsm/qr1t2JG+g6G7Rm3Du2qVt61yeCl6dA/zQ0= Received: by 10.38.92.15 with SMTP id p15mr67840rnb; Mon, 22 Aug 2005 04:27:03 -0700 (PDT) Received: by 10.38.209.1 with HTTP; Mon, 22 Aug 2005 04:27:03 -0700 (PDT) Message-ID: Date: Mon, 22 Aug 2005 23:27:03 +1200 From: Jonathan Roewen To: caml-list@yquem.inria.fr Subject: [Caml-list] Module initialiser functions Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 4309B688.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 initialiser:01 ocaml:01 compiler:01 makefile:01 ocaml:01 mli:01 wildcard:01 mli:01 cmx:01 cmx:01 ocamlopt:01 -linkpkg:01 cmxa:01 -output-obj:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Hi, Is it guaranteed that the initialisers for each module will be run in the order of modules specified to the ocaml compiler? Say, with the given Makefile: ML=09 =3D ocaml/device.ml ocaml/keyboard.ml ocaml/console.ml ocaml/thread.ml ocaml/irq.ml ocaml/kernel.ml MLI=09 =3D $(wildcard ocaml/*.mli) CMX=09 =3D $(ML:.ml=3D.cmx) OCAMLKERNEL=09=3D ocaml/ocamlkernel.o $(OCAMLKERNEL): $(CMX) =09$(OCAMLOPT) -linkpkg $(CMXA) $(CMX) -output-obj -o $@ For instance: I want to have it such that keyboard.ml registers a device during init, and then console.ml registers a device which depends on opening the keyboard device earlier registered. But the only way this is guaranteed to work is if I can make some sort of guarantees about the order that initialisers are called at the module level. Does ocaml make any sort of guarantees like this? Or will depending on this to happen be too fragile? Jonathan