Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] default values for record field definitions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ian Zimmerman <itz@s...>
Subject: Re: [Caml-list] default values for record field definitions

Alexander> Why not to introduce a syntax for default values of record
Alexander> fields:

Alexander> type rec1 = { attr1: type1 = val1; attr2: type2; attr3:
Alexander> type3 = val3 }

Alexander> It this case constructions of the form

Alexander> let x = { attr2 = val2 } are possible, with other fields
Alexander> filled by val1, val3.

type rec1 = { attr1: type1; attr2: type2; attr3: type3 };
let rec1_default = { attr1 = val1; attr2 = val2; attr3 = val3 } in
let x = { rec1_default with
        attr2 = val2'
         }
and ...

BTW, I couldn't find this in the manual!

-- 
Ian Zimmerman, Oakland, California, U.S.A.
EngSoc adopts market economy: cheap is wasteful, efficient is expensive.
GPG pub key: 433BA087 9C0F 194F 203A 63F7 B1B8 6E5A 8CA3 27DB 433B A087
-------------------
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