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=1.1 required=5.0 tests=AWL,DNS_FROM_SECURITYSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 45ED5BB84 for ; Thu, 13 Nov 2008 00:22:23 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUAACP0GknLOwFslGdsb2JhbACUNQEBAQEJCwgJEQS8cweDUA X-IronPort-AV: E=Sophos;i="4.33,592,1220220000"; d="scan'208";a="19129140" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 13 Nov 2008 00:22:23 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id mACNMMfb024795 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 13 Nov 2008 00:22:22 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUAACP0GknLOwFslGdsb2JhbACUNQEBAQEJCwgJEQS8cweDUA X-IronPort-AV: E=Sophos;i="4.33,592,1220220000"; d="scan'208";a="19129138" Received: from outbound.icp-qv1-irony-out1.iinet.net.au ([203.59.1.108]) by mail3-smtp-sop.national.inria.fr with ESMTP; 13 Nov 2008 00:22:20 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEACP0GknLzuai/2dsb2JhbADRZgeDUA X-IronPort-AV: E=Sophos;i="4.33,592,1220198400"; d="scan'208";a="415872937" Received: from unknown (HELO hendrix.mega-nerd.net) ([203.206.230.162]) by outbound.icp-qv1-irony-out1.iinet.net.au with ESMTP; 13 Nov 2008 08:22:17 +0900 Received: from hendrix (hendrix [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id 57BA4AB13B for ; Thu, 13 Nov 2008 10:22:17 +1100 (EST) Date: Thu, 13 Nov 2008 10:22:17 +1100 From: Erik de Castro Lopo To: caml-list@inria.fr Subject: Ocaml 3.01 and camlp4 syntax? Message-Id: <20081113102217.87faf573.mle+ocaml@mega-nerd.com> Reply-To: caml-list@inria.fr Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 491B652E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 camlp:01 syntax:01 efuns:01 emacs:01 efuns:01 compiler:01 genlex:01 lexer:01 lexer:01 parser:01 compiler:01 complained:01 camlp:01 Hi all, Mostly out of curiosity, I'm having a look at the efuns Emacs clone written in Ocaml: http://pauillac.inria.fr/cdrom/prog/unix/efuns/eng.htm and trying to compile it with a recent Ocaml compiler like 3.10.2. >>From the files, it seems that the last version of Ocaml this code compiled with was 3.01 (around the year 2000?). I've managed to find fixes for a bunch of problems. One of those problems was that one of the files (common/options.ml) had code like this: open Genlex let lexer = make_lexer [ "=" ; "{" ; "}"; "["; "]"; ";" ; "("; ")"; ","; "."] let rec parse_gwmlrc = parser [< id = parse_id; 'Kwd "="; v = parse_option ; eof = parse_gwmlrc >] -> (id, v) :: eof | [< >] -> [] which the current compiler complained about "[<". A bit of googling suggested that this was in fact camlp4 source code. Sure enough, renaming that file to pa_options.ml and running it throught camlp4 resulted in a file that the standard compiler digested quite happily. I've now come to another file gwml/afterstep.mll that seems to be ocamllex source code but again has these camlp4 like extensions. Unfortunately camlp4 doesn't like this file, probably because it has ocamllex syntax instead of ocaml syntax. So, I have two questions : 1) Did early versions of ocaml (say up to and including 3.01) handle constructs like those above that were later removed and and added to camlp4 instead? 2) Any suggestions on how to handle the camlp4 syntax stuff in an ocamllex source file? Obviously, this code could be extracted and placed in its own file but I'm open to other suggestions. Cheers, Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- Seen on comp.lang.python: Q : If someone has the code in python for a buffer overflow, please post it. A : Python does not support buffer overflows, sorry.