Browse thread
[Caml-list] default values for record field definitions
-
Alexander V. Voinov
- Ian Zimmerman
-
Dmitry Bely
- Alexander V. Voinov
- FabienFleutot
- Daniel de Rauglaudre
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Alexander V. Voinov <avv@q...> |
| Subject: | Re: [Caml-list] default values for record field definitions |
Hi All,
Ian Zimmerman wrote:
> 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'
> }
Dmitry Bely wrote:
>
> type rec1 = { attr1: type1; attr2: type2; attr3: type }
> let default_rec1 = { attr1 = init_val1; attr2 = init_val2; attr = init_val3 }
> ...
> let x = { default_rec1 with attr2 = val2 }
>
Yes, this is nice. But it's a workaround.
Alexander
-------------------
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