caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <Pierre.Weis@inria.fr>
To: mattias.waldau@abc.se (Mattias Waldau)
Cc: caml-list@inria.fr
Subject: Re: Why does the order in the Makefile matter?
Date: Sat, 28 Oct 2000 18:55:08 +0200 (MET DST)	[thread overview]
Message-ID: <200010281655.SAA31819@pauillac.inria.fr> (raw)
In-Reply-To: <HDEEKOMJILGEIHIMAPCDIEGCDEAA.mattias.waldau@abc.se> from Mattias Waldau at "Oct 28, 100 10:01:13 am"

> Two runs 'make all', the only difference in the order in the OBJS-line in
> the Makefile.
> 
> What is the needed order? Should I use the order of .depend?

A Caml implementation file (a .ml file) is a list of definitions and
expression evaluations.

-- definitions can only refer to preceding definitions (due to the
so-called ``static'' binding rule) and cannot refer to following
definitions.

-- top-level expressions may appear anywhere in implementation files and those
expressions define the runtime computation. They must be evaluated in
the exact order specified by the user in his source file (otherwise
strange things may happen if ``exit 0;;'' is evaluated before ``main
();;''!).

Hence, when the entire program is made of multiple implementation
files, those files must be linked in any order that is compatible with
the static binding rule: no definition can be linked if it refers to
an identifier that is defined after the definition at hand.  In
addition, expressions to be computed must evidently appear in any
order compatible with the desired runtime behaviour.

Hope this helps,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/




  reply	other threads:[~2000-10-28 17:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-28  8:01 Mattias Waldau
2000-10-28 16:55 ` Pierre Weis [this message]
2000-10-30  8:30   ` Why does the order in the Makefile matter? --- Linking with C kahl
2000-10-31  7:39   ` Why does the order in the Makefile matter? Mattias Waldau
2000-11-01  7:38   ` Stephan Houben
2000-11-02 18:22     ` Pierre Weis
2000-11-03  7:24       ` Judicael Courant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200010281655.SAA31819@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mattias.waldau@abc.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).