Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Walid Taha <taha@cs.chalmers.se>
To: John Prevost <jmp@arsdigita.com>
Cc: Markus Mottl <mottl@miss.wu-wien.ac.at>, caml-list@inria.fr
Subject: Re: Imperative programming in Caml
Date: Tue, 8 Aug 2000 20:30:19 +0200 (MET DST)	[thread overview]
Message-ID: <Pine.SOL.4.21.0008082026110.562-100000@muppet70.cs.chalmers.se> (raw)
In-Reply-To: <87ya27vcgk.fsf@localhost.localdomain.>


Hi John,

> If you write:
> 
> imperative call;
> let x = blah in
>   imperative call
> 
> then you get a little distracted by the indentation.  

Got it!

> Mmm.  I don't think you're going to have much success at showing that
> O'Caml is a reasonable language without using at least some
> polymorphism.  Perhaps this restatement of my previous code would
> help, though:
> 
> type optional_int =
>        | No_Int
>        | Some_Int of int

I feel you were "righter" the first time.  An "option" type is somehow
semanticaly implict in having "null/nill" in every pointer.  So, I think
it is reasonable to interpreter "'a pointer" as "'a option ref".  This
also suggests a naturally way to translate imperative programs to
functional programs systematically.

Thanks again for the great feedback.

Walid.



  reply	other threads:[~2000-08-08 20:42 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 [this message]
2000-08-08 21:10                 ` Pierre Weis
2000-08-09 13:50                   ` Walid Taha
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.0008082026110.562-100000@muppet70.cs.chalmers.se \
    --to=taha@cs.chalmers.se \
    --cc=caml-list@inria.fr \
    --cc=jmp@arsdigita.com \
    --cc=mottl@miss.wu-wien.ac.at \
    /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