caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: asmadeus77@gmail.com
To: "Fabrice Marchant" <fabricemarchant@free.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] functions' recursive construction
Date: Tue, 8 Jul 2008 00:48:34 +0200	[thread overview]
Message-ID: <b79ece760807071548w51d03962l184ca9b94d6227ae@mail.gmail.com> (raw)
In-Reply-To: <20080707211133.21ee2905@free.fr>

Hello,

I am not sure I remember what was said exactly, and I'm quite too lazy
to check, but I remember that someone gave a possible implementation
with Obj.magic ?
This also is about the same as the Printf functions which can take a
variable amount of arguments and need a bit of tinkering, and I
remember a function 'eat", taking an integer n, which would ignore the
n first arguments given to the function. Now, if you have this,
getting the first argument should be possible after looking at the
printf source :) (although I could not find it searching in my mails,
sorry)

Actually, I've just glanced at the source and there _is_ a "get_arg"
function, taking a single integer and returning an Obj.magic'ed item
which would most likely be the nth argument of a function - however I
can't separate the function from the rest of the code properly in just
a minute, but it definitly is a place to look at if you need such a
function... Although it might be quite dangerous. But as it was said,
the type is impossible to represent and magic is probably necessary
without typing multiple calls to functions manually; but Jeremy's
solution could be enough :)

Good luck,
Dominique Martinet


  reply	other threads:[~2008-07-07 22:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-22 23:17 Damien Lefortier
2007-05-22 23:21 ` [Caml-list] " Jon Harrop
2007-05-22 23:31   ` Lukasz Stafiniak
2007-05-22 23:32     ` Lukasz Stafiniak
2007-05-22 23:41       ` Jon Harrop
2007-05-23  6:25     ` Jean-Christophe Filliatre
2008-07-07 18:01 ` Fabrice Marchant
     [not found]   ` <a58674cc0807071304x1640d670sde3045a0920a5922@mail.gmail.com>
2008-07-07 18:28     ` Fabrice Marchant
2008-07-07 20:40       ` Jeremy Yallop
     [not found]   ` <C3DD7276-23D5-41BE-A272-7579586A5559@gmail.com>
2008-07-07 18:36     ` Fabrice Marchant
2008-07-07 20:25   ` Jeremy Yallop
2008-07-07 19:11     ` Fabrice Marchant
2008-07-07 22:48       ` asmadeus77 [this message]
2008-07-08  9:24       ` Daniel Bünzli

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=b79ece760807071548w51d03962l184ca9b94d6227ae@mail.gmail.com \
    --to=asmadeus77@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=fabricemarchant@free.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;
as well as URLs for NNTP newsgroup(s).