English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
Functional unparsing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-04-15 (21:41)
From: Hezekiah M. Carty <hcarty@a...>
Subject: Re: [Caml-list] Functional unparsing
On Wed, Apr 15, 2009 at 4:41 PM, Andrey Riabushenko <cdome@bk.ru> wrote:
> Something like that:
> Stats.linear_regression "y ~ x1 exp(x2) log(x3) x3^2"
> Returns float -> float -> float -> float -> regression_result = <fun>
> 2. The second question regarding function unparsing. I haven't used this
> technique before. Are there some docs, blog articles, descriptions and etc?
> The only relevant documentation I have found is printf.ml :). Might someone
> have a minimal working example to demonstrate?

The Batteries Print module and associated syntax extension may be a
useful base for implementing something similar to what you are


This allows for syntax like:
Print.printf p"This is a list of integers: %{int list}"
to return:
int list -> unit = <fun>


Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science