From: SourceForge.net <no...@so...> - 2011-02-28 13:51:12
|
Feature Requests item #3194813, was opened at 2011-02-28 03:26 Message generated for change (Comment added) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3194813&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: jfaucher (jfaucher) Assigned to: Nobody/Anonymous (nobody) Summary: Add support for ::attribute myAttribute raise novalue Initial Comment: ::attribute myAttribute raise novalue An ::attribute with default 'get' implementation never raises NOVALUE. You have to provide your own 'get' implementation like that : ::attribute myAttribute get expose myAttribute signal on novalue return myAttribute novalue: raise propagate I propose to let support this kind of declaration : ::attribute myAttribute raise novalue which will automatically generate the code above. >>-::ATTRIBUTE--name--+---------------+---- +-RAISE NOVALUE-+ +-GET-----------+ +-SET-----------+ In complement to RFE 3001080 (Add a NOVALUE switch to ::OPTIONS) It would be nice if the ::options novalue could change the default 'get' implementation of all methods of the package, as described above. ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2011-02-28 08:51 Message: Yes, that RFE would result in that behavior. I think, in general, SIGNAL ON NOVALUE is only generally useful for large, monolithic classic-style programs where a single label target can be used for an entire program. Since this really is a debugging/reliability issue, having an option to make this an error would achieve the same ends. ---------------------------------------------------------------------- Comment By: jfaucher (jfaucher) Date: 2011-02-28 08:47 Message: ok, let's forget the ::attribute raise novalue. This morning, for debug, I added 'signal on novalue' in each method, and was surprised to have no error and still see the wrong value MYATTRIBUTE. Until I understood that I had to add 'signal on novalue' in the ::attributes. Since I use NOVALUE mainly for debug, what I'm looking for is what you propose in RFE 3001080. I suppose that with ::option NOVALUE, an error will be raised when reading an attribute without value ? If this is correct, then I will delete my RFE. ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2011-02-28 06:51 Message: I am generally NOT in favor of this enhancement. Attributes are NOT variables, they are methods. NOVALUE conditions are a variable concept and are raised only on the current call context. This just further confuses the concepts. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3194813&group_id=119701 |