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
Handling include files using ocamllex
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-05 (10:33)
From: Erik de Castro Lopo <mle+ocaml@m...>
Subject: Re: [Caml-list] Handling include files using ocamllex
skaller wrote:

> You should share that experience here. It's hard to know
> when to go for a class and when a simpler algebraic data
> structure is better, so user experience reports (use cases)
> are valuable data.

Well the problem was that I wanted to do this:

    class lexstack top_filename 
            val mutable filename = top_filename
            val mutable chan = open_in top_filename
            val lexbuf = Lexing.from_channel chan

Oops, error message right there ^^^^^^ trying to use instance
variable chan.

> Yep, it should. But you probably should generalise to 
> support conditional compilation as well.

Not part of my requirements so I'll skip that :-).

Erik de Castro Lopo
"Only wimps use tape backup: *real* men just upload their
important stuff on FTP, and let the rest of the world
mirror it ;)" -- Linus Torvalds