From: SourceForge.net <no...@so...> - 2009-05-11 13:58:44
|
Feature Requests item #2500398, was opened at 2009-01-12 02:26 Message generated for change (Settings changed) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=2500398&group_id=10894 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: 35. TclOO Package Group: None Status: Open Resolution: None >Priority: 8 Private: No Submitted By: Colin McCormack (coldstore) Assigned to: Donal K. Fellows (dkf) Summary: add variables with 'variable' decl Initial Comment: It seems that [variable] within class declaration doesn't 'accumulate' variable names, so there can only be a single [variable] in the declaration. I would expect the following to produce "moop v3 1" instead of erroring. package require TclOO namespace import oo::* class create Vartest { variable v3 variable v1 v2 method moop {v} { puts stderr "moop $v [set $v]" } method woo {} { my moop v1 my moop v2 my moop v3 } constructor {} { set v1 1 set v2 1 set v3 1 } } Vartest create test test woo PRODUCES: tclsh8.6 tcloo.tcl moop v1 1 moop v2 1 can't read "v3": no such variable while executing "set $v" (class "::Vartest" method "moop" line 2) invoked from within "my moop v3" (class "::Vartest" method "woo" line 4) invoked from within "test woo" (file "tcloo.tcl" line 24) ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2009-05-11 14:56 Message: As this is really a FRQ for a slot-like management scheme for variables, I'm moving this to another tracker. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2009-03-24 16:19 Message: “Do”? It's working as specified and as documented. ---------------------------------------------------------------------- Comment By: Eric Boudaillier (beric) Date: 2009-03-13 18:24 Message: Hello Donal, Just to remind you... What do you intend to do for this? Personnaly, I would prefer the 'append' behaviour. The 'set' behaviour is not usual in Tcl. ---------------------------------------------------------------------- Comment By: Colin McCormack (coldstore) Date: 2009-01-12 10:45 Message: I don't mind which way it works, although I tend to like to have a variable declaration with associated comments. I'd expected it to be like [method] rather than [superclass], but can live with however it falls. Possibly this needs to be more clearly documented. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2009-01-12 10:42 Message: Right now, the 'variable' declaration 'sets' rather than 'appends'. In this, it is like the 'superclasses', 'mixins' and 'filters' decls. Arguably this should be different; I'm in two minds about it. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2009-01-12 10:42 Message: Right now, the 'variable' declaration 'sets' rather than 'appends'. In this, it is like the 'superclasses', 'mixins' and 'filters' decls. Arguably this should be different; I'm in two minds about it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=2500398&group_id=10894 |