Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Re: Toplevel question ...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Re: Toplevel question ...
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