Extending XOTcl Attribute slot
- From: jima <jima00@xxxxxxxxx>
- Date: Wed, 31 Oct 2007 13:00:36 -0700
Hi,
I am trying to extend the XOTcl Attribute slot but I find that I
cannot declare methods with just no arguments as I run into some kind
of collision with Attribute definition.
I think I can explain it better by means of an example: let us try to
have a list Attribute that does pop !
Class AttL -superclass Attribute
AttL instproc init {
args
} {
next
my multivalued true
}
AttL instproc pop {
obj
var
} {
set res [lindex [$obj $var] end]
lreplace [$obj $var] end end
return $res
}
Class A -slots {
AttL MyList
}
A a
a MyList add 5
a MyList add 6
puts [a MyList pop]
I was expecting the 5 to appear (add is adding at the beginning) but
instead I got just pop.
Does this mean I cannot define a method as intended with no arguments
apart from the context?
I would appreciate any suggestions on this.
Thanks !
jima
.
- Prev by Date: Re: Controlling a windows program
- Next by Date: question on ttk::notebook restrictions
- Previous by thread: freewrap helper
- Next by thread: question on ttk::notebook restrictions
- Index(es):