From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Damien.Doligez@inria.fr (Damien Doligez)
Cc: Pierre.Weis@inria.fr, caml-list@pauillac.inria.fr
Subject: Re: Question point fixe
Date: Wed, 19 Oct 1994 09:59:48 +0100 (MET) [thread overview]
Message-ID: <9410190859.AA23880@pauillac.inria.fr> (raw)
In-Reply-To: <9410181917.AA27432@couchey.inria.fr> from "Damien Doligez" at Oct 18, 94 08:17:17 pm
> > Why is it impossible to write:
> > let rec monf = build monf;;
>
> Because the compiler does not want to know anything about "build"
> (except its type) when it compiles "monf". Thus it doesn't know
> whether "build" will use its argument or not. If "build" does use its
> argument, there is no way to make this work. This is the same as
> writing:
> let rec x = succ x;;
Not quite, because "monf" is a function while "x" above is an integer.
For a function, the compiler could initialize "monf" with
(fun _ -> raise Bottom), then evaluate "build monf" (raising "Bottom"
if "build" applies "monf"), then update the initial value as usual.
I'm not saying the compiler should do that: it's painful to implement
and it breaks a nice property of the current compilation for "let
rec", which is that if a "let rec" definition is accepted, then it
always succeeds at run-time in finding the fixpoint.
I would suggest that Vincent Poirriez either tolerates the efficiency
loss implied by "let rec monf x = build monf x", or uses a reference
to compute the fixpoint himself.
- Xavier Leroy
next prev parent reply other threads:[~1994-10-19 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-10-18 19:17 Damien Doligez
1994-10-19 8:59 ` Xavier Leroy [this message]
-- strict thread matches above, loose matches on Subject: below --
1994-10-18 10:42 Pierre Weis
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=9410190859.AA23880@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=Damien.Doligez@inria.fr \
--cc=Pierre.Weis@inria.fr \
--cc=caml-list@pauillac.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