caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matt Gushee <mgushee@havenrock.com>
To: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] Fwd: Polymorphic optional label argument, with default
Date: Sat, 10 Apr 2004 17:52:06 -0600	[thread overview]
Message-ID: <20040410235206.GB10420@swordfish> (raw)
In-Reply-To: <20040410213616.GA28863@redhat.com>

On Sat, Apr 10, 2004 at 10:36:16PM +0100, Richard Jones wrote:
> 
> I have a function defined:
> 
>   let plot ?(labels = string_of_int) graph =
>     (* ... *)

I don't think I can directly address your problem as stated here, but I
have one or two observations that might be relevant:

 * I had to grapple with a similar issue in developing my ChartPak
   toolkit: how do you generate a string from an arbitrary data type?
   I decided on an architecture where each chart type is implemented as
   an OCaml module. That module transforms a data set into a collection
   of abstract graphical objects (by that I mean that their shapes and
   relative positions are defined, but their actual dimensions are not).
   This collection is passed to a renderer which creates the actual
   image.

   This approach is more complex internally and less dynamic than I
   would like, but it does make for an API that is both fairly simple
   to use and not too hard to extend (assuming you can compile OCaml 
   code).

 * Do you really need to handle arbitrary data types? You will certainly
   have floats, ints, and strings, but what else? Maybe you should focus
   on providing a simple interface for the most common data types.

 * BTW, what sort of application/library are you working on here? If it
   is much like mine (and is open source and intended for general
   distribution), maybe we should think about joining forces.


-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

-------------------
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


  parent reply	other threads:[~2004-04-10 23:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-10 21:36 Richard Jones
2004-04-10 22:40 ` Gerd Stolpmann
2004-04-11  0:03   ` skaller
2004-04-10 23:52 ` Matt Gushee [this message]
2004-04-11  6:26 ` Brian Hurt
2004-04-11  8:33   ` Richard Jones
2004-04-11  9:01     ` skaller
2004-04-11 13:16     ` Jacques Garrigue
2004-04-11 15:23       ` nadji
2004-04-12  2:25         ` Jacques Garrigue

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=20040410235206.GB10420@swordfish \
    --to=mgushee@havenrock.com \
    --cc=caml-list@pauillac.inria.fr \
    /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).