English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Type annotations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-25 (21:40)
From: John Prevost <jmp@a...>
Subject: Re: Ref syntax
>>>>> "mk" == Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl> writes:

    mk> The only consistent syntax would be "!x <-
    mk> new_contents_of_x". Note that the revised syntax uses "x.val
    mk> <- new_contents_of_x", with x.val being equivalent to old !x
    mk> on both sides of <- and without the need of any magic syntax
    mk> for references in addition to what is available anyway for
    mk> mutable fields.

Of course, in the standard syntax you can write "x.contents <- 1" in
the same way.  Though that's quite a bit more verbose.