Subj : Re: OO compilers and efficiency To : comp.programming From : Jon Harrop Date : Wed Jul 27 2005 11:43 am Chris Dollin wrote: > Jon Harrop wrote: > > Why do you say "limited" update? > > In ML you can update only array elements and the contents of Ref > cells, if I remember correctly. In Scheme, it appears to be part > of the culture rather than the language, but I could easily be > out-of-date. > > As opposed to languages where, generally speaking, variables are > expected to, well, vary, unless you take syntactic steps - `const`, > `final` - to say otherwise. Right, so there is an equivalence: C <-> ML int int ref const int int My objection was only that I wouldn't have called the ML side "limited" because it can do everything that the C side can. In OCaml (probably SML too) you can also update record fields which have been marked "mutable". In fact, a "ref" is nothing more than a record with a single mutable field: type 'a ref = { mutable contents: 'a } -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .