caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: [Caml-list] Re: [Caml-list] Question sur les références.
Date: Fri, 28 Dec 2001 16:45:15 +0100	[thread overview]
Message-ID: <20011228164515.H16590@verdot.inria.fr> (raw)
In-Reply-To: <3C2C7FC9.86AD1CA3@free.fr>; from watchdog@free.fr on Fri, Dec 28, 2001 at 03:20:57PM +0100

Salut,

On Fri, Dec 28, 2001 at 03:20:57PM +0100, WatchDog wrote:

> let resultat (a,b,c,d) position =
>     let pos=ref position in
>   !pos.(d).(c) <- !pos.(b).(a) ; !pos.(b).(a) <- V ;
> !pos ;;

C'est normal, c'est comme si tu écrivais:

  let resultat (a,b,c,d) position =
      let pos= position in
    pos.(d).(c) <- pos.(b).(a) ; pos.(b).(a) <- V ;
  pos ;;

> let x = ref 1 in x := !x + 1;;
> ça ne modifie pas la valeur de l'entier 1, non ???

Ben non. Mais 1 n'est pas une valeur mutable, tandis qu'un tableau,
c'est mutable.

Tu peux écrire:
    a.(i) <- b
et pas:
    1 <- b

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      parent reply	other threads:[~2001-12-28 15:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-28 14:20 WatchDog
2001-12-28 15:36 ` hubert.fauque
2001-12-28 16:18   ` WatchDog
2001-12-28 17:27     ` hubert.fauque
2001-12-29 16:54       ` [Caml-list] lablGL and GLUT Christophe Raffalli
2001-12-30  8:15     ` [Caml-list] Re: [Caml-list] Question sur les références Alan Schmitt
2001-12-30 11:05       ` Daniel de Rauglaudre
2002-01-01 11:20         ` [Caml-list] " Alan Schmitt
2001-12-28 15:45 ` Daniel de Rauglaudre [this message]

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=20011228164515.H16590@verdot.inria.fr \
    --to=daniel.de_rauglaudre@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;
as well as URLs for NNTP newsgroup(s).