Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Walid Taha <taha@cs.chalmers.se>
To: Pierre Weis <Pierre.Weis@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: Imperative programming in Caml
Date: Wed, 9 Aug 2000 15:50:22 +0200 (MET DST)	[thread overview]
Message-ID: <Pine.SOL.4.21.0008091539340.562-100000@muppet70.cs.chalmers.se> (raw)
In-Reply-To: <200008082110.XAA20025@pauillac.inria.fr>


Dear Pierre,

Thank you for you comments.

> Your problem seems to have something to do with elementary programming
> in Caml; you may have a look at the documentation, in particular the
> FAQ where basic indentation hints are given in the programming guide
> lines (http://pauillac.inria.fr/caml/FAQ/pgl-eng.html), and questions
> about imperative programming in Caml including the existence of
> imperative pointers and their encoding in Caml are discussed in
> details (http://pauillac.inria.fr/caml/FAQ/pointers-eng.html).

I took a quick look, and both seem to be very good pointers.  I like the
systematic translation suggested.

> Note: if you really do not want to use any kind of polymorphism, I'm
> afraid you will have a bad time to write and explain imperative
> programming examples in Caml, since you cannot use references ('a
> ref), nor arrays ('a array), nor options ('a option), nor lists ('a
> list); if you also consistently banish polymorphism from your function
> type schemes, what could you do without the basic predicates such that
> (=) (that has type 'a -> 'a -> bool), or even any comparison
> predicates (<, <=, <>, ...)  that are also polymorphic ?

This is a good point.  I had overlooked the fact that "ref" itself is a
polymorphic type constructor.

Best regards,

Walid.



  reply	other threads:[~2000-08-09 14:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-25 21:47 overhead of GC in caml runtime? Norman Ramsey
2000-07-28  9:52 ` Xavier Leroy
2000-08-03 19:20   ` Imperative programming in Caml Walid Taha
2000-08-04 19:43     ` Markus Mottl
2000-08-04 19:57       ` Walid Taha
2000-08-06  1:59         ` John Prevost
2000-08-08 18:01           ` Walid Taha
2000-08-08 18:23             ` John Prevost
2000-08-08 18:30               ` Walid Taha
2000-08-08 21:10                 ` Pierre Weis
2000-08-09 13:50                   ` Walid Taha [this message]
2000-08-04 18:33 Don Syme
2000-08-04 19:48 ` Walid Taha

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=Pine.SOL.4.21.0008091539340.562-100000@muppet70.cs.chalmers.se \
    --to=taha@cs.chalmers.se \
    --cc=Pierre.Weis@inria.fr \
    --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