From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA26041 for caml-redistribution; Fri, 29 Jan 1999 09:46:40 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA02496 for ; Thu, 28 Jan 1999 21:09:32 +0100 (MET) Received: from irritatie.cs.kun.nl (irritatie.cs.kun.nl [131.174.33.129]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id VAA19004 for ; Thu, 28 Jan 1999 21:09:31 +0100 (MET) Received: (from tews@localhost) by irritatie.cs.kun.nl (8.8.7/8.8.7) id VAA01245; Thu, 28 Jan 1999 21:10:13 +0100 Date: Thu, 28 Jan 1999 21:10:13 +0100 Message-Id: <199901282010.VAA01245@irritatie.cs.kun.nl> From: Hendrik Tews MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: Re: Looking for a nail In-Reply-To: <199901261920.LAA23249@kronstadt.transbay.net> References: <199901252053.VAA21739@irritatie.cs.kun.nl> <199901261920.LAA23249@kronstadt.transbay.net> X-Mailer: VM 6.22 under 19.15 XEmacs Lucid Sender: weis Hi, From: Ian T Zimmerman Date: Tue, 26 Jan 1999 11:20:47 -0800 Subject: Re: Looking for a nail [concerning an oo interface to ocamllex] No. Sorry, but I don't want to be forced to use classes. I want to Hold on! This was only a suggestion to somebody looking for a nail! I agree that the possibility of choosing between (or even mixing) the functional and the oo paradigm is one of the great advantages of ocaml. Therefore there should always be a functional version of the standard libray. But, by the same argument it would be nice, to have an oo version. > - adding start conditions a la flex to ocamllex I haven't thought of this really hard, but I bet there is already a way to do that. If there isn't, I would think hard again to find a cleaner, more functional (less stateful) way to do it. If the current condition is kept in a global as in flex, that just drops again the reentrancy that Christian has been working so hard to achieve. Yes, indeed, you can do the following: { type lexer_state_type = A | B let lexer_state = ref A } rule token = parse "" { match !lexer_state with A -> atoken lexbuf | B -> btoken lexbuf } and atoken = parse ... But it would be nice to have an intuitive syntax for that. Bye, Hendrik