Tcl (Itcl) and default parameters/arguments
- From: mghembru@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (MH)
- Date: Mon, 29 Aug 2005 20:17:37 +0000 (UTC)
Hi. I'm working in Itcl, and I'm wondering if this is possible:
itcl::class x {
public variable y;
public method a { {p1 $y} } {
puts "Value is: $p1"
}
}
That is - can I use a VARIABLE as the default value? If so, what am I doing
wrong?
Right now, I get:
% source x.tcl
% x y
y
% y configure -y 3
% y a
Value is: $y
%
Obviously, I'd like to get:
% y a
Value is: 3
Any comments? I've searched the Itcl and Tcl docs + wiki, with no "this is
impossible" or "this can be done using method xyz".
I suspect it's NOT possible, but it would be REALLY nice if it were.
Mattias
.
- Follow-Ups:
- Re: Tcl (Itcl) and default parameters/arguments
- From: Bob Techentin
- Re: Tcl (Itcl) and default parameters/arguments
- Prev by Date: Re: ANNOUNCE: Tk on SDL
- Next by Date: .text search unexpected match
- Previous by thread: twapi extension in Windows XP Embedded
- Next by thread: Re: Tcl (Itcl) and default parameters/arguments
- Index(es):