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 |
From: SourceForge.net <no...@so...> - 2009-07-12 18:07:34
|
Feature Requests item #2796100, was opened at 2009-05-24 07:38 Message generated for change (Comment added) made by miesfeld 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. ---------------------------------------------------------------------- >Comment By: Mark Miesfeld (miesfeld) Date: 2009-07-12 11:07 Message: I would find this useful, especially in mixin classes. How would the qualifier work in that case? For example, something I had just the other day: ::class MyDlg subclas RcDialog inherit AdvancedControls where I would have liked to access an object variable in AdvancedControls from the MyDlg subclass. Would it be possible to set up that scoping? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=2796100&group_id=119701 |
From: SourceForge.net <no...@so...> - 2009-07-12 18:21:02
|
Feature Requests item #2796100, was opened at 2009-05-24 10:38 Message generated for change (Comment added) 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. ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2009-07-12 14:21 Message: That was the intent. Thus you'd be able to specify expose foo:.AdvancedControls to indicate the scope of the exposed variables. ---------------------------------------------------------------------- Comment By: Mark Miesfeld (miesfeld) Date: 2009-07-12 14:07 Message: I would find this useful, especially in mixin classes. How would the qualifier work in that case? For example, something I had just the other day: ::class MyDlg subclas RcDialog inherit AdvancedControls where I would have liked to access an object variable in AdvancedControls from the MyDlg subclass. Would it be possible to set up that scoping? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=2796100&group_id=119701 |