From: Blair Zajac <blair@orcaware.com>
To: dsl@intellij.com
Cc: A Joseph Koshy <koshy@india.hp.com>,
Xavier Leroy <xavier.leroy@inria.fr>,
caml-list@inria.fr
Subject: Re: [Caml-list] The need for opcode GRAB?
Date: Fri, 15 Nov 2002 11:24:21 -0800 [thread overview]
Message-ID: <3DD549E5.4B538DD9@orcaware.com> (raw)
In-Reply-To: <200211151600.31088.dsl@intellij.com>
Dmitry Lomov wrote:
>
> On Friday 15 November 2002 12:15, A Joseph Koshy wrote:
> > Perhaps a basic question about the O'Caml bytecode interpreter:
> >
> > Why do we need to check at runtime if a function is being
> > partially applied? Isn't this information available to the
> > compiler?
>
> No it is not:
>
> implementation A.ml:
> let f x y = x + y
> let g x = if x = 1 then fun y -> y else fun y -> y - 1
>
> interface A.mli:
> val f : int -> int -> int
> val g : int -> int -> int
>
> usage (somewhere outside A):
> let k = (A.f 1) (* this application is partial *)
> let r = (A.g 1) (* this application is not partial *)
>
> Compiler cannot distinguish between those two cases
> (knowing only A interface).
>
> BTW a GRAB/RESTART trick is very cool IMHO.
> My students always "Wow!" at it. Any references as to
> where it comes from (or was it a Xavier's own clever idea?)
What is the grab/restart trick? Is there a URL to an explanation?
I didn't find anything definitive through Google.
Best,
Blair
--
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
-------------------
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
next prev parent reply other threads:[~2002-11-15 19:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-15 9:15 A Joseph Koshy
2002-11-15 13:00 ` Dmitry Lomov
2002-11-15 19:24 ` Blair Zajac [this message]
2002-11-16 0:18 ` Alan Schmitt
2002-11-18 8:29 ` Dmitry Lomov
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=3DD549E5.4B538DD9@orcaware.com \
--to=blair@orcaware.com \
--cc=caml-list@inria.fr \
--cc=dsl@intellij.com \
--cc=koshy@india.hp.com \
--cc=xavier.leroy@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