From: SourceForge.net <no...@so...> - 2009-05-24 14:38:20
|
Feature Requests item #2796100, was opened at 2009-05-24 10:38 Message generated for change (Tracker Item Submitted) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=2796100&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interpreter Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Rick McGuire (bigrixx) Assigned to: Nobody/Anonymous (nobody) Summary: Allow scope qualifier on expose Initial Comment: When writing subclasses, it is sometimes awkward to access variables defined in a superclass. Generally this requires that the superclass add accessor methods which are generally less efficient than direct variable access and may open up access to wider than desired access. For the expose instruction, it would be nice to qualify the variable on expose the same way method invocations can be used. For example, expose name:super would expose the name variable in the super class context. It might be nice to allow an environment symbol to be specified that can allow access to any class in the hierarchy. If this is done, then the equivalent function should be added to the native APIs to allow native methods equivalent access. This does expose subclasses a little more to the "fragile base class problem". It might be reasonable to immediately raise an error if a variable exposed in this way does not exist in the super class scope. This would preclude exposing these variables in an init method, but would also introduce a level of reliability since it allows errors to be more easily diagnosed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=2796100&group_id=119701 |