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 + array
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-10-04 (17:08)
From: Anastasia Gornostaeva <ermine@e...>
Subject: camlp4 + array
Hello.

The code

       let pl =
            Array.fold_left (fun ls l -> <:expr< $ls$; $`int:l$ >>)
            <:expr<>> some_array
          in
            <:expr< [| $pl$ |] >>

produces somelike [| (1; 2; 3; 4) |], i.e the pl in () brackets.
How should I do write this code properly?

ermine