Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: John Prevost <prevost@maya.com>
To: knotwell@f5.com
Cc: caml-list@inria.fr
Subject: Re: a parsing question
Date: 04 May 2000 13:29:26 -0400	[thread overview]
Message-ID: <87ya5qb4w9.fsf@isil.localdomain> (raw)
In-Reply-To: knotwell@f5.com's message of "Thu, 4 May 2000 07:49:07 -0700"

>>>>> "kn" == knotwell  <knotwell@f5.com> 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:

blah.ml ------------

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.

John.  



      parent reply	other threads:[~2000-05-04 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-04 14:49 knotwell
2000-05-04 16:57 ` Jean-Yves Moyen
2000-05-04 17:29 ` John Prevost [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ya5qb4w9.fsf@isil.localdomain \
    --to=prevost@maya.com \
    --cc=caml-list@inria.fr \
    --cc=knotwell@f5.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox