Re: MinMaxArray
- From: Jeroen Mostert <jmostert@xxxxxxxxx>
- Date: Wed, 09 Jul 2008 12:17:39 +0200
Marc Gravell wrote:
Arrays are immutable.Well, they can't be resized, but are definitely mutable regarding the contents of an array... but I'm not quite sure how that relates to the question, unless the OP wants to Add(), rathen than just swap items.
Yeah, I realized "immutable" was the wrong word to use (and I managed to confuse myself as well). It was indeed thinking of a collection where you add elements after the fact and want the aggregates to be updated immediately, although then I realized that a mutable collection that can't be resized is just as problematic.
I like these "too clever by half" solutions on an intellectual level, but I wouldn't actually stick them in my production code. No offense. :-)There are various ways of mitigating this, but they're all more or less trying to
fit a square peg in a round hole.
Other pegs are available ;-p
I guess Operator would be an "amost round" peg... some kind of icosagon or similar - there are a few gaps, but it comes close...
If I want C++, Smalltalk or Haskell (each of which would solve this problem in its own distinct way) I know where to get them. For C#, LINQ's good enough for me... Either that or maybe two specialized classes for Decimal and Double.
--
J.
.
- Follow-Ups:
- Re: MinMaxArray
- From: Marc Gravell
- Re: MinMaxArray
- References:
- MinMaxArray
- From: Ondrej Medek
- Re: MinMaxArray
- From: Jeroen Mostert
- Re: MinMaxArray
- From: Marc Gravell
- MinMaxArray
- Prev by Date: Re: scheduling
- Next by Date: Re: WPF: Custom control and resorce files in a different assembly.
- Previous by thread: Re: MinMaxArray
- Next by thread: Re: MinMaxArray
- Index(es):
Relevant Pages
|