Re: Reference classquery
"Frederic Merizen" <[email protected]> Thu, 28 Aug 2008 10:27:19 +0200 (CEST)
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
Philippe Ribet: > Paolo Redaelli wrote: > >>I would rename the class. Perhaps REFERENCED[INTEGER] could be clearer >>to understand and nearer to its semantic. >> > I'm not sure it's clearer. The integer you set is not referenced: > a: INTEGER > ra: REFERENCED[INTEGER] > ra.set_item(a) > a is not referenced by ra. My two cents: -Class names are generally nouns, so "REFERENCED" would be unorthodox. Of course, we could jump on the DSL bandwagon to make "REFERENCED" trendy. -In my opininion, for an expanded classes A, REFERENCE[A] really is a box (I believe the term "boxed integer" is reasonably standard). -Note that REFERENCE[A] is also useful if A is a reference classe (if you want to share a mutable reference between several objects). In this case, REFERENCE really is a reference. -There's also WEAK_REFERENCE[A], which is only useful if A is a reference class. I'm not sure I'd bother renaming the class. -- Frederic Merizen