Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
From: John Prevost <jmp@a...>
Subject: Re: Ref syntax
>>>>> "mk" == Marcin 'Qrczak' Kowalczyk <> 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.