Vectors and matrices in D
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Thu Mar 15 13:32:22 PDT 2007
[corrected upside-down post]
Jascha Wetzel wrote:
> Frits van Bommel wrote:
>> Jascha Wetzel wrote:
>>> ok, the const part is missing, but the performance part can be dealt
>>> with. maybe "const inout" is a worthwhile feature for future D versions.
>>> it should have a less contradictory name, though.
>> Hey, no fair correcting yourself before I finish my post! ;)
>>
>> Seriously: as I mentioned in my post there was some discussion a while
>> back about adding this sort of stuff, but so far nothing concrete has
>> shown up.
>
> ;)
>
> maybe we could have an additional "inref" modifier. on the other hand
> "out" doesn't force write-only either, atm.
'out' does force initialization though. Before anything can be read from
or written to the parameter, it's automatically set to the initial value
of its type. So you can read it, but it won't have the value it had in
the context of the caller (unless, of course, that value was the initial
value :) ).
> therefore i think having a way to return references/lvalues is more
> important on that front.
This was IIRC also a topic in the discussion I mentioned.
> i'd really like to do matrix[row,col] += bla;
So would I. Though I think that syntax is currently possible with proxy
objects, that's not the most elegant solution.
More information about the Digitalmars-d-learn
mailing list