Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
functions' recursive construction
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-07 (22:48)
From: asmadeus77@g...
Subject: Re: [Caml-list] functions' recursive construction

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,

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