Walter Bright wrote: > Consider non-nullable type T: > > T[] a = new T[4]; > ... time goes by ... > T[1] = foo; > T[3] = bar; > ... more time goes by ... > bar(T[2]); > > In other words, I create an array that I mean to fill in later, because > I don't have meaningful data for it in advance. What do I use to default > initialize it with non-nullable data? And once I do that, should > bar(T[2]) be an error? How would I detect the error? > <sarcasm> Consider immutable type immutable T:
immutable T] a = new immutable T[4];
... time goes by ...
T[1] = foo;
T[3] = bar;
In other words I create an array that I mean to fill in later,
because I don't have meaningful data for it in advance. How do I do
that with immutable types?
</sarcasm>
Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]
signature.asc
Description: OpenPGP digital signature
