Hi,
The object in XPP is not an array, at
least it cannot be accessed using [] operator and IMHO it's quite good
idea because it introduce some encapsulation which allows to eliminate
some code used to validate object structure at runtime.
Maybe we should also think about adding such extensions to Harbour.
Anyhow they will have to be optional because they will interact with
some existing Clipper code which may use some tricks based on low level
Clipper compatibility could be reached, even if we decide to drop []
support for objects. o[1], o[2], ... could be emulated using [] operator
overload even for an object with a different internal structure from
Clipper.
In Clipper and Harbour HB_IT_ARRAY == HB_IT_OBJECT, so it will change
ABI in some cases.
OOP implementation in Clipper, f.e. instead of:
o:var := 123.45
some can use:
o:_var( 123.45 )
etc.
I see a different topic than "object as array" here. It's agreement on
naming of assign methods. If we want to change this we will need add
more pcodes to denote assignment. If assignment has a special pcode,
perhaps object variable access should have a separate pcode also, i.e.
o:var and o:var() should/can be a different things.
BTW, in Clipper we were forced to use &("o:_var(123.45)") in macros,
because &("o:var := 123.45") gives Syntax error.
Regards,
Mindaugas
P.S. Przemyslaw have You looked at GPF in extended HashObject() sample
I've sent a few days ago? It not that I'd like to make you hurry, I just
get lost a little in class implementation and was not able to fix this GPF.
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour