How to call a function in main()?

bearophile bearophileHUGS at lycos.com
Tue Jul 23 16:03:18 PDT 2013


Jaehunt:

> I mean when function has "T[]" in the front, how am I calling 
> it?

If it's a sorting routine, then it probably sorts data in-place, 
so it's more clear to not return data. If the function copies 
inside the input data before sorting it, then it's right to 
return the result.
That's why in Python sort returns nothing and sorted() returns 
data.
The D sort finds a third way, returning something that is not 
exactly the input data :-)

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list