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
Class variables in O'Caml???
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1996-05-10 (16:10)
From: Thorsten Ohl <ohl@c...>
Subject: Re: Class variables in O'Caml??? + questions

>>>>> "Christian" == Christian Boos <> writes:

Christian> IMO, the use of references is not so unnatural. Together
Christian> with structs, it provides a clean way to encapsulate global
Christian> state and actions for classes.

Sure, it us possible to do it.  But, IMHO, class variables should be
declared in the class and be opaque.  If you put several classes in a
module, the use of module wide references makes much less sense.
Another hack is to define a sub-module for each class, but that's not
nice either ...

I'm just curious if (and why) this syntactic sugar has been left out
Thorsten Ohl, Physics Department, TH Darmstadt --- PGP: AF 38 FF CE 03 8A 2E A7 -------- 8F 2A C1 86 8C 06 32 6B