From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1D0A4BC69 for ; Sun, 5 Aug 2007 12:33:51 +0200 (CEST) Received: from smtp.syd.people.net.au (smtp.syd.people.net.au [218.214.225.98]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l75AXmSG018029 for ; Sun, 5 Aug 2007 12:33:49 +0200 Received: (qmail 4692 invoked from network); 5 Aug 2007 10:34:02 -0000 Received: from unknown (HELO hendrix.mega-nerd.net) (218.214.64.136) by smtp.syd.people.net.au with SMTP; 5 Aug 2007 10:34:02 -0000 Received: from hendrix (hendrix [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id 0DD262FEA1 for ; Sun, 5 Aug 2007 20:33:47 +1000 (EST) Date: Sun, 5 Aug 2007 20:33:46 +1000 From: Erik de Castro Lopo To: caml-list@inria.fr Subject: Re: [Caml-list] Handling include files using ocamllex Message-Id: <20070805203346.b05112c7.mle+ocaml@mega-nerd.com> In-Reply-To: <1186308994.9925.132.camel@rosella.wigram> References: <20070802200933.3621fb1a.mle+ocaml@mega-nerd.com> <1186060770.23889.39.camel@rosella.wigram> <20070805145238.76aed5d6.mle+ocaml@mega-nerd.com> <1186308994.9925.132.camel@rosella.wigram> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.11; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46B5A78C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocamllex:01 val:01 mutable:01 val:01 mutable:01 lexbuf:01 lexing:01 generalise:01 compilation:01 wrote:01 caml-list:01 oops:01 data:02 data:02 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 object 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 -- ----------------------------------------------------------------- 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