On Tue, Dec 23, 2003 at 03:41:03AM +0100, Martin B?hr wrote:
string, int and float are passed by reference contrary to the behaviour of a normal function.
array, mapping and multiset are passed by reference always, contrary to string, int and float - so anyway there is some confusion (for those who don't know). Perhaps, cleaner solution would be to implement a reference to variable (something like x(int &x) in C/C++ or x(ref int i) in C#), but this is another question.
as for the convenience, array_sscanf() fills the need nicely.
Not really. First - you have to allocate array (well, it _will_ be allocated), second - you may need to assign values from this array to variables. Every array allocation is expensive (comparing to simple assignment), and every access to array and assignment after this - additional penalty.
Imagine that your application doing sscanf() most of time, then try to replace sscanf() with array_sscanf() - you will see the difference. Not that this is _so_ critical nowadays, but "why pay more?"
Regards, /Al