Purity
Simen kjaeraas
simen.kjaras at gmail.com
Tue Feb 1 06:15:42 PST 2011
Bruno Medeiros <brunodomedeiros+spam at com.gmail> wrote:
>> But for immutable data (like the contents of the elements of a
>> string[]),
>> that doesn't matter, does it?
>>
>
> Maybe it won't matter for the *contents of the elements* of the string
> array, but the whole result value has to be /the same/ as if the
> optimization was not applied. Otherwise the optimization is invalid,
> even if for most uses of the result value it would not make a difference
> for the program.
I admit to still not understanding this.
The data can't be changed, so the contents do not matter. The array structs
(prt/length) would not be the same as those fed to the function in any
case,
so I really cannot see how those would matter.
If others do understand, please elucidate.
--
Simen
More information about the Digitalmars-d
mailing list