Hi,
Hm, I find this extremely unnatural and even dangerous. In fact I didn't understand the whole fuss about "autoadd" when lengthy discussion were going on. Now I know what it was all about. For me it'd be the last thing I want that my hash table automatically extends with new members _on access_. Maybe this is normal for other languages, I don't know.
Sometimes this autoadd is very useful: DBEVAL({|| hHash[ FIELD->CODE ] += FIELD->AMOUNT })
Moreover you need a distinct function just to check the existence of a key. Ideally hb_HGet( h, k ) != NIL could do this, and with the third parameter, this would be even better, doing what you and probably most developers would expect.
No! HB_HGET( h, k ) == NIL, if hash HAS key k associated to value NIL.
I think that's not the question, but rather if we want to keep the RTE in hb_HGet() at all.
I want to keep RTE.
xhb compatibility is not a concern BTW, because it uses different function names anyway.
I do not know any xhb compatibility issues about hashes. It was written by Przemek from scratch, and all xhb compatibility (like hHash:method support) is in xhb.lib.
For sure, Harbour's hash implementation details looks very messy to me. Management of some xhb heritage is a real burden :( (see also hb_AIns()/hb_ADel(), logging, .ini files, ...)
Yes, I remember all discussion about Clipper functions extension. Finally, I do not use HB_AINS()/HB_ADEL(), but use AINSS(), ADELS() which always adjust size of array (the last letter "S" of function name is abbrv. of "Size") and does not need the third parameter .T./.F. .
But not everything is xhb heritage. For example, yesterday my friend asked: do we have a function like RAT() with parameter nStartFrom. I do not know if xharbour has such extension, but it is much easier to do string parsing by passing nStartFrom instead of using LEFT() and modifying the string by cutting-off at the last separator in each loop. Harbour could not have such function by accepted "Clipper compatibility rules", or it will by one more Clipper function clone-extension like HB_RAT().
Best regards, Mindaugas _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour