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
Syntax for partial copy of struct member
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <ocaml-erikd@m...>
Subject: Re: Syntax for partial copy of struct member
Erik de Castro Lopo wrote:

>     let y = { a = 2 ; (* b and c filled in from x *) }
> but I can't for the life of me remember the syntax.

And as soon as I post to the list, I suddenly remember:

     let y = { x with a = 2 }

Sorry for distrubing everyones weekend.

  Erik de Castro Lopo
"There is only a small difference between a strong atheist and 
a Christian: they agree on a very long list of gods that don't 
exist, and disagree about only one of them."