caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Erik de Castro Lopo <mle+ocaml@mega-nerd.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Handling include files using ocamllex
Date: Sun, 05 Aug 2007 20:16:34 +1000	[thread overview]
Message-ID: <1186308994.9925.132.camel@rosella.wigram> (raw)
In-Reply-To: <20070805145238.76aed5d6.mle+ocaml@mega-nerd.com>

On Sun, 2007-08-05 at 14:52 +1000, Erik de Castro Lopo wrote:

> I tried that with a class and ran into all sorts of problems
> related to trying to use instance data in the constructor.

You should share that experience here. It's hard to know
when to go for a class and when a simpler algebraic data
structure is better, so user experience reports (use cases)
are valuable data.

> In the end, I ditched the class/object but kept your idea
> and approached it from a more functional direction which
> resulted in this (filename lexstack.ml):

> I haven't tested it as thoroughly as I should have, but the
> general idea seems to work.

Yep, it should. But you probably should generalise to 
support conditional compilation as well. Felix provides
that facility. Preprocessor 'macro' symbols are never
expanded in the source code, only in preprocessor
directives.

Even very basic facility is fairly general and can be
used to solve porting problems as a fallback if other
more well disciplined techniques fail.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  parent reply	other threads:[~2007-08-05 10:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02 10:09 Erik de Castro Lopo
2007-08-02 10:29 ` [SPAM?][Caml-list] " Christoph Bauer
2007-08-02 10:42   ` [Caml-list] " Erik de Castro Lopo
2007-08-02 13:19   ` [SPAM?][Caml-list] " skaller
2007-08-05  4:52     ` [Caml-list] " Erik de Castro Lopo
2007-08-05  5:35       ` Erik de Castro Lopo
2007-08-05 10:16       ` skaller [this message]
2007-08-05 10:33         ` Erik de Castro Lopo
2007-08-05 11:55           ` Jacques GARRIGUE
2007-08-05 12:17             ` Erik de Castro Lopo

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=1186308994.9925.132.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=mle+ocaml@mega-nerd.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;
as well as URLs for NNTP newsgroup(s).