RFC: naming for FrontTransversal and Transversal ranges

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri May 1 16:23:45 PDT 2009


Rainer Deyke wrote:
> Robert Jacques wrote:
>> Precisely, so it's always passed by reference and doesn't need to
>> support copying.
> 
> All containers need to support copying.

Speaking of which, I'm thinking of a field like scientific computing 
(even of the simplest, most basic kind that we all dabble into) or 
applied math. People who use for example matrices would NOT expect them 
to have reference semantics. They'd find it very confusing if a = b 
would not make matrix "a" a copy of matrix "b" and so on. (That + no 
operator overloading = R.I.P. my excitement for doing numeric work in Java.)

It would work to ask people who actually use Matrix!double to wrap it in 
a Value!(Matrix!double). But say someone asks, whatever, but if 
Value!(Matrix!double) is a matrix, then what is Matrix? Well, I'd reply, 
Matrix is actually a reference to a matrix. Then, they'll ask, why don't 
you call what you call today "Matrix", RefMatrix or Ref!Matrix or 
whatever, and call a Matrix a matrix? Um, I don't know. That's what the 
buzz was on the newsgroup when we were thinking of it. Some said that's 
what people coming from Java expect.

I guess at that point the would-be D user would be entitled to make me a 
lavaliere out of my Matrix library and move on.


Andrei



More information about the Digitalmars-d mailing list