From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA04004; Mon, 4 Mar 2002 19:42:30 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA04291 for ; Mon, 4 Mar 2002 19:42:30 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g24IgTv09682 for ; Mon, 4 Mar 2002 19:42:29 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id TAA12359 for caml-list@inria.fr; Mon, 4 Mar 2002 19:42:29 +0100 Date: Mon, 4 Mar 2002 19:42:29 +0100 From: Daniel de Rauglaudre To: Caml List Subject: Re: [Caml-list] Re: Toplevel question ... Message-ID: <20020304194229.L31447@verdot.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from johnh@ichips.intel.com on Mon, Mar 04, 2002 at 09:10:16AM -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Mon, Mar 04, 2002 at 09:10:16AM -0800, Harrison, John R wrote: > Even if the OCaml developers don't want to add this feature to the > default toplevel, it must be very easy to support using Camlp4. Perhaps > Daniel de Rauglaudre or another expert can tell us how? $ cat it.ml #load "pa_extend.cmo"; #load "q_MLast.cmo"; open Pcaml; EXTEND top_phrase: [ [ sti = str_item; ";;" -> match sti with [ <:str_item< $exp:e$ >> -> Some <:str_item< value it = $e$ >> | x -> Some x ] ] ] ; END; $ ocamlc -pp camlp4r -I +camlp4 -c it.ml $ ocaml Objective Caml version 3.04+6 (2002-02-05) # #load "camlp4o.cma";; Camlp4std Parsing version 3.04+6 (2002-02-05) # #load "it.cmo";; # 2 + 2;; val it : int = 4 -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners