From: Junbiao Zhang <junzhang@ccrl.nj.nec.com>
To: caml-list@inria.fr
Subject: forward function definitions
Date: Wed, 9 Jun 1999 14:38:22 -0400 (EDT) [thread overview]
Message-ID: <Pine.GSO.4.10.9906091354050.14576-100000@flame> (raw)
Hi,
We're developing a fairly large system with multiple function
definitions. It's inevitable that some functions may call other functions
defined later(may not even be recursive calls as in the case of
Sys.Signal_handle). My question is: how do I solve such a problem which is
extremely trival in other languages? Thanks.
--Junbiao
My current solution is really ugly:
let a_forward_ref =
(ref (fun _ -> raise (Failure "undefined") : int -> unit));;
let register_signals () =
.....
Sys.signal Sys.sigalrm (Sys.Signal_handle !a_forward_ref)
.....
.........
let a sigid =
......
let assign_a_forward_ref () =
a_forward_ref := ref a
And im main()(may be in another file):
......
assign_a_forward_ref ()
......
I must be missing something or this language is:)
next reply other threads:[~1999-06-11 23:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-09 18:38 Junbiao Zhang [this message]
1999-06-14 10:55 ` Sven LUTHER
1999-06-14 16:17 ` Pierre Weis
1999-06-16 13:03 ` luther sven
1999-06-16 20:55 ` Pierre Weis
1999-06-17 8:46 ` Sven LUTHER
1999-06-14 10:34 Toby Moth
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=Pine.GSO.4.10.9906091354050.14576-100000@flame \
--to=junzhang@ccrl.nj.nec.com \
--cc=caml-list@inria.fr \
/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