Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
a parsing question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-05-04 (18:11)
From: John Prevost <prevost@m...>
Subject: Re: a parsing question
>>>>> "kn" == knotwell  <> writes:


    kn> Unfortunately, I don't know how to "export" yoyo_time to
    kn> parser.mli.  My Makefile currently does the following:

    kn>     echo "val yoyo_time: int ref" >> parser.mli

    kn> While this works fine, I'd like to avoid using Make as a
    kn> post-processor.

The right solution is to define yoyo_time in another module: ------------

let yoyo_time = ref 10
let set_yoyo_time newtime = yoyo_time := (int_of_string newtime)

blah.mli ------------

val yoyo_time : int ref
val set_yoyo_time : string -> unit

parser.mly ----------

open Blah

This way you can stay away from touching the scary .mli file generated
by ocamlyacc.