caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] récupération de paramètre
@ 2001-05-03 15:07 Guy Yeterian
  2001-05-03 20:07 ` Jean-Christophe Filliatre
  0 siblings, 1 reply; 5+ messages in thread
From: Guy Yeterian @ 2001-05-03 15:07 UTC (permalink / raw)
  To: caml-list

Bonjour,

	si je construis un programme qui prend comme paramètre une fonction
comment puis-je récupérer cette fonction et l'utiliser sans déclancher
une erreur de type. (sys__command_line est un vecteur de string et je ne
connais pas de fonction du type function_of_string en caml-light ?)

	le programme en question est une dichotomie sur une fonction  style
		dicho(f,a,b,e)

	avec (evidemment) :
	f de type float -> float
	a de type float ...

si vous avez une idée ??

merci d'avance.
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] récupération de paramètre
  2001-05-03 15:07 [Caml-list] récupération de paramètre Guy Yeterian
@ 2001-05-03 20:07 ` Jean-Christophe Filliatre
  2001-05-03 22:49   ` Remi VANICAT
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe Filliatre @ 2001-05-03 20:07 UTC (permalink / raw)
  To: Guy Yeterian; +Cc: caml-list


Il n'y a pas d'acces au compilateur Caml aussi simple que
"function_of_string" (comment cela pourrait-il etre statiquement type,
d'ailleurs ?) Il y a cependant plusieurs manieres de faire, dont entre
autres :

  - dans un toplevel, l'inclusion d'un morceau de code avec #use
    (qui peut par exemple definir une fonction f, la stocker dans
    une reference, etc.)

  - la compilation d'un module definissant une fonction f (avec un
    appel externe au compilo Caml) puis un chargement dynamique de ce
    code avec le module Dynlink

  - la definition de votre propre type pour les fonctions dont vous
    avez besoin, le parseur et l'interpreteur associes, bref votre
    mini Caml dans Caml :-)

Cordialement,
-- 
Jean-Christophe FILLIATRE
  mailto:Jean-Christophe.Filliatre@lri.fr
  http://www.lri.fr/~filliatr


Guy Yeterian writes:
 > Bonjour,
 > 
 > 	si je construis un programme qui prend comme paramètre une fonction
 > comment puis-je récupérer cette fonction et l'utiliser sans déclancher
 > une erreur de type. (sys__command_line est un vecteur de string et je ne
 > connais pas de fonction du type function_of_string en caml-light ?)
 > 
 > 	le programme en question est une dichotomie sur une fonction  style
 > 		dicho(f,a,b,e)
 > 
 > 	avec (evidemment) :
 > 	f de type float -> float
 > 	a de type float ...
 > 
 > si vous avez une idée ??
 > 
 > merci d'avance.
 > -------------------
 > To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] récupération de paramètre
  2001-05-03 20:07 ` Jean-Christophe Filliatre
@ 2001-05-03 22:49   ` Remi VANICAT
  2001-05-07 10:07     ` Fabrice Le Fessant
  0 siblings, 1 reply; 5+ messages in thread
From: Remi VANICAT @ 2001-05-03 22:49 UTC (permalink / raw)
  To: caml-list

Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr> writes:

> Il n'y a pas d'acces au compilateur Caml aussi simple que
> "function_of_string" (comment cela pourrait-il etre statiquement type,
> d'ailleurs ?) Il y a cependant plusieurs manieres de faire, dont entre
> autres :
> 
>   - dans un toplevel, l'inclusion d'un morceau de code avec #use
>     (qui peut par exemple definir une fonction f, la stocker dans
>     une reference, etc.)
> 
>   - la compilation d'un module definissant une fonction f (avec un
>     appel externe au compilo Caml) puis un chargement dynamique de ce
>     code avec le module Dynlink
> 
>   - la definition de votre propre type pour les fonctions dont vous
>     avez besoin, le parseur et l'interpreteur associes, bref votre
>     mini Caml dans Caml :-)
> 
> Cordialement,

il y a aussi la solution dynamic caml (http://oops.tepkom.ru/dml/)

-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] récupération de paramètre
  2001-05-03 22:49   ` Remi VANICAT
@ 2001-05-07 10:07     ` Fabrice Le Fessant
  2001-05-10 11:22       ` Dmitry Lomov
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Le Fessant @ 2001-05-07 10:07 UTC (permalink / raw)
  To: Remi VANICAT; +Cc: caml-list


In Ocaml, you can use the asmdynlink library, which provides an "eval"
function for bytecode and native programs... and is included in the
CDK :)

- Fabrice

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] récupération de  paramètre
  2001-05-07 10:07     ` Fabrice Le Fessant
@ 2001-05-10 11:22       ` Dmitry Lomov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Lomov @ 2001-05-10 11:22 UTC (permalink / raw)
  To: caml-list

Unfortunately, I do not know French, so I did not quite got
what the original poster needs, but as an alteranative to a heavy weight
'eval' function from asmdynlink (that essentially invokes the whole
Objective Caml compiler to do the job of translating a single expression), 
Dynamic Caml library might be used.
See http://oops.tepkom.ru/dml.

Regards,
Dmitry

On Mon, 7 May 2001, Fabrice Le Fessant wrote:

> 
> In Ocaml, you can use the asmdynlink library, which provides an "eval"
> function for bytecode and native programs... and is included in the
> CDK :)
> 
> - Fabrice

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-05-10 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-03 15:07 [Caml-list] récupération de paramètre Guy Yeterian
2001-05-03 20:07 ` Jean-Christophe Filliatre
2001-05-03 22:49   ` Remi VANICAT
2001-05-07 10:07     ` Fabrice Le Fessant
2001-05-10 11:22       ` Dmitry Lomov

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).