Hi all, Today, inspired by this message: http://caml.inria.fr/pub/ml-archives/caml-list/2006/10/6f9aaa1bdd7f959e92ccd1be147da5ed.en.html I wrote this small camlp4 extension (attached) to 'open' recursive functions. functions specified with 'orec' are re-written as follows: let orec fib x = match x with | 0 -> 0 | 1 -> 1 | n -> fib (n - 1) + fib (n - 2) let rec fib_aux fib_rec x = match x with 0 -> 0 | 1 -> 1 | n -> fib_rec (n - 1) + fib_rec (n - 2) and fib t = fib_aux fib t Even if it works for small examples, I'm not sure if this approach is sound in general, in particular with mutually recursive functions. Did I miss something obvious ? p ocamlc -c -pp 'camlp4o -I . pa_extend.cmo q_MLast.cmo' -I /usr/lib/ocaml/3.09.2/camlp4/ pa_polyrec.ml camlp4o -I . pa_extend.cmo q_MLast.cmo pr_o.cmo pa_polyrec.cmo pt.ml -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html