Closed Bug 641641 Opened 14 years ago Closed 6 years ago

ANI: slot getters and AS3 getters (+setters) are confusing

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: stejohns, Unassigned)

References

Details

Nomenclature issue: Historically, a native implementation of a getter/setter in AS3 was named get_propname/set_propname in AS3. With the addition of wrappers to get/set member slots directly, a similar nomenclature was used, but prepended with namespace to avoid collisions (eg get_private_propname). We'd like to expand the use of the member slot accessors, but want to avoid confusion with the implementation and/or call of similarly named getter/setters, which have function semantics, not data. Idea #1: obfuscate the AS3 native implementation name for getters/setters, e.g. "impl_get_propname", then require C++ clients to use the callin wrapper (see bug 634638), eg "call_get_propname". I'm not wild about this because "call_get" strikes me as weird-sounding. Idea #2: adopt a different nomenclature for the slot accessors; e.g. "peek_propname/poke_propname". (Not really serious about those names, as wonderfully old-school as they may be, but you get the idea.)
Getters and setters are not properties but methods and this is apparent in the language, eg, interfaces can carry getters and setters but not properties. If it's a getter then the only candidate name we have for the function is "get propname". Ergo call_get_propname, though an eyesore, is reasonable provided the programmer understands the language reasonably well. Alternatively, use names like "getter_propname" and "setter_propname", or more informatively, "call_getter_propname". "Peek" and "poke" obfuscate what's going on - getters and setters are under no obligation to read or write anything whatsoever. Anything that indicates the contrary is probably not a good idea, which is another reason why I think "getter_propname" is better than "get_propname".
(In reply to comment #1) > "Peek" and "poke" obfuscate what's going on - getters and setters are under no > obligation to read or write anything whatsoever. right, and agreed -- I was proposing peek/poke as an example of a naming convention for the direct-slot-accessors, *not* the getter/setter functions.
Assignee: stejohns → nobody
Blocks: ANI
Flags: flashplayer-qrb+
Flags: flashplayer-injection-
Flags: flashplayer-bug-
Target Milestone: --- → Future
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.