On Sat, Jan 29, 2005 at 01:00:01AM +0100, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
o Your class don't support the weak flags. Otoh it's not possible to do transparently since set_weak_flag currently doesn't try lfuns.
what will be the effect of this when using the class instead of a real mapping?
o cast: The casts to int, float, string and multiset are meaningless since they won't work.
i know, i left them in to have it display the error pike gives when trying that, because i am not happy with the default errormessage which should not use %O on this, but display the name of the class. (i'll try to fix that though. can i get the name of this_program() as a string?)
o No `+=? Ok, it's optional but allows for good optimization.
`+= was documented as being used for a destructive append. since i want to emulate mappings, += should not be destructive.
o Most C level functions that take mappings don't accept objects, so explicit casting will be necessary there.
well, most of the other code won't either, so the user will have to be doing castings anyways. though it would be nice if pike would generally allow objects with _is_type("mapping") being true, where the allowed type is mapping.
greetings, martin.