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
camlp4: Curried constructor error
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-02 (13:20)
From: Joel Reymont <joelr1@g...>
Subject: camlp4: Curried constructor error

I have a the following function and invocation:

let render = <:octalfile<templ.html>>

print_endline (Xml.to_string_fmt (Templ.render ~page ~visitor));;

I thought I would make render take an argument so I first tried

let render x = <:octalfile< x >>

print_endline (Xml.to_string_fmt (Templ.render "templ.html" ~page  

File "main.ml", line 31, characters 34-46:
This function is applied to too many arguments,
maybe you forgot a `;'

I thought I would make render take a couple more arguments

let render x y z = <:octalfile< x >> y z

but this complains

File "ghost-location", line 1, characters 0-0:
Parse error: currified constructor

What's the proper way to make render take a file name?

	Thanks, Joel