caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Evan Martin <martine@danga.com>
To: dido@imperium.ph
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] handling forward references in a compiler
Date: Tue, 25 May 2004 12:59:13 -0700	[thread overview]
Message-ID: <20040525195913.GE2304@lulu> (raw)
In-Reply-To: <20040525095213.GA2655@imperium.ph>

On Tue, May 25, 2004 at 05:52:13PM +0800, dido@imperium.ph wrote:
> I'm writing a compiler for a language that allows undeclared forward
> references in OCaml, and I'm just wondering how one is supposed to
> handle these sorts of things without resorting to imperative features or
> multiple passes.

Thanks for asking this question.  I'm actually stuck on almost the same
problem right now.  I resorted to doing both:  filling out hash tables
in an initial pass.  I figure that the global namespace is not
dynamic--in contrast with locally-scoped bindings--so it's ok to use it
imperatively; I never need any version of it except for the final one.
In other words, there's only one full, accurate picture of the global
namespace (while the local bindings vary from scope to scope), so I
might as well take a pass to figure it out completely.

But I'm eager to read what others have to say.

-- 
Evan Martin
martine@danga.com
http://neugierig.org

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2004-05-25 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-25  9:52 dido
2004-05-25 11:00 ` skaller
2004-05-25 19:59 ` Evan Martin [this message]
2004-05-26 11:31 ` Marcin 'Qrczak' Kowalczyk

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=20040525195913.GE2304@lulu \
    --to=martine@danga.com \
    --cc=caml-list@inria.fr \
    --cc=dido@imperium.ph \
    /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).