Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: John Whitley <whitley@cse.buffalo.edu>
To: caml-list@inria.fr
Subject: RE: Looking for a nail
Date: Sun, 31 Jan 1999 13:43:12 -0500 (EST)	[thread overview]
Message-ID: <14004.38166.379525.372253@hadar.cse.Buffalo.EDU> (raw)
In-Reply-To: <39ADCF833E74D111A2D700805F1951EF0F00B93A@RED-MSG-06>

Don Syme writes:
 > Yes, I'd be interested to see a really convincing use of the
 > utility of the OO features, e.g. a program or library which is
 > manifestly shorter, cleaner and/or simpler when expressed with OO
 > rather than the core features.

Here's an example of something that I would like to be able to do:

If arrays were implemented as a class, then I could subclass them with
something that I was tentatively calling an arrayView class.  The
arrayView is constructed from an existing array, a stride, an offset,
and a length.  The new class only need override the array get and set
element methods, inheriting all remaining operations.  The goal is
that an arrayView can be used by any function/method that requires an
array.

The application that motivated the above idea is a lifting-scheme
based wavelet transform I have written for my research.  This
algorithm requires splitting the input into evens and odds, altering
each even/odd sub-array, then recursing on each sub-array.

The implementation in OCaml (actually, I'm using OLabl) presently
requires that I use a while loop.  (not quite back to Fortran IV,
but...;-) A for-statement with step would clean things up somewhat.
Finally, I think that the ability to create an arrayView class like I
describe would be a useful step for exploring the practice of the OO
and "core Caml" features.

IMHO, languages that support classes but lack a standard class library
aren't really "object-oriented" in an important sense.  In OCaml's
case, I suspect that the lack of a standard library has inhibited
exploration of OO-style in OCaml.

-- John




  parent reply	other threads:[~1999-02-03 11:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-28 13:32 Don Syme
1999-01-29  0:25 ` Markus Mottl
1999-01-31 18:43 ` John Whitley [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-01-29  0:45 Frank A. Christoph
1999-01-25 20:53 Hendrik Tews
1999-01-26 19:20 ` Ian T Zimmerman
1999-01-28  1:30   ` John Prevost
1999-01-28 20:10   ` Hendrik Tews
1999-01-27  1:29 ` Jacques GARRIGUE
1999-01-27  8:27 ` Jean-Christophe Filliatre
1999-01-28  9:34 ` Cuihtlauac ALVARADO
1999-01-24 21:06 Miles Egan
1999-01-24 23:01 ` Lyn A Headley
1999-01-25  8:44   ` Jean-Christophe Filliatre
1999-01-25 20:45     ` Markus Mottl
1999-01-25 13:36   ` mattwb
1999-01-25 20:48     ` Trevor Jim
1999-01-25 21:57   ` Gerd Stolpmann
1999-01-25 12:45 ` Michel Schinz
1999-01-25 20:37   ` Markus Mottl
1999-01-28  9:54     ` Michel Schinz
1999-01-28 14:13       ` Markus Mottl

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=14004.38166.379525.372253@hadar.cse.Buffalo.EDU \
    --to=whitley@cse.buffalo.edu \
    --cc=caml-list@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