caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Radu Grigore <radugrigore@gmail.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] 'a Set?
Date: Sat, 29 Jan 2005 11:55:19 +0200	[thread overview]
Message-ID: <7f8e92aa0501290155dde6f47@mail.gmail.com> (raw)
In-Reply-To: <20050126.210400.42882977.garrigue@math.nagoya-u.ac.jp>

On Wed, 26 Jan 2005 21:04:00 +0900 (JST), Jacques Garrigue
<garrigue@math.nagoya-u.ac.jp> wrote:
> There seems to be an habit of having side-effecting functions take
> their "object" as first parameter, while side-effect-free functions
> take them as last.

This makes sense; but it does not seem to be respected by the standard
library. For example Queue does modifications in place and doesn't
take the queue as the first parameter. Another example is List.nth
which does not have side-effects but takes the list as the first
parameter. And I didn't even tried to look for examples that don't
follow your rule: I was more or less randomly browsing the manual.

> If you respect this convention, the type tells you about the semantics
> :-)

It is a good convention and I'll try follow it. Thanks.

-- 
regards,
 radu
http://rgrig.idilis.ro/


  parent reply	other threads:[~2005-01-29  9:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25 23:54 Mike Hamburg
2005-01-26  8:25 ` [Caml-list] " Jean-Christophe Filliatre
2005-01-26 10:13   ` Frédéric Gava
2005-01-26 11:04     ` Radu Grigore
2005-01-26 12:04       ` Jacques Garrigue
2005-01-26 16:00         ` Alex Baretta
2005-01-26 16:14           ` Jacques Carette
2005-01-26 21:09           ` Mike Hamburg
2005-01-29  9:55         ` Radu Grigore [this message]
2005-01-26  9:13 ` Jon Harrop
2005-01-26 15:36   ` Frédéric Gava
2005-01-26 16:06     ` Jon Harrop

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=7f8e92aa0501290155dde6f47@mail.gmail.com \
    --to=radugrigore@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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).