Re: Tcl (Itcl) and default parameters/arguments
- From: mghembru@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (MH)
- Date: Mon, 29 Aug 2005 21:46:42 +0000 (UTC)
In article <devv1t$f52$1@xxxxxxxxxxxxxxxx>,
Bob Techentin <techentin.robert@xxxxxxxx> wrote:
>"MH" <mghembru@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote
>> 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"
>> }
>> }
>
>
>I don't think that it is possible.
>
>But you can work around it. Use {args}, count the parameters, and do things
>the hard way. A little easier, but not quite as robust, is something like:
>
> public method a { {p1 VERY_UNLIKELY_DEFAULT} } {
> if { $p1 eq VERY_UNLIKELY_DEFAULT } {
> set p1 $y
> }
> }
Yup, I know how to work around it - just didn't want to if I didn't have to
:-)
Thanks.
Mattias
.
- References:
- Tcl (Itcl) and default parameters/arguments
- From: MH
- Re: Tcl (Itcl) and default parameters/arguments
- From: Bob Techentin
- Tcl (Itcl) and default parameters/arguments
- Prev by Date: Re: Rename folders
- Next by Date: Re: OT: emacs as ... Re: Tcl Editor
- Previous by thread: Re: Tcl (Itcl) and default parameters/arguments
- Next by thread: Re: Tcl (Itcl) and default parameters/arguments
- Index(es):