Re: [tkined] Question about object-type DEFVAL

Peder Chr. Norgaard (pcn@tbit.dk)
Thu, 18 Mar 1999 15:35:59 +0100 (MET)

On Thu, 18 Mar 1999, Juergen Schoenwaelder wrote:

>
> >>>>> Peder Chr Norgaard writes:
>
> Peder> Considering Tcl's very limited type system, I suggest the most
> Peder> elegant semantics would be the one used with Tcl's "regexp"
> Peder> command: let the command deliver the "boolean" as the return
> Peder> value, and give the "value" in a named upvar'd variable. If
> Peder> you worry about backwards compatibility, you can use the
> Peder> current (ambigious) interpretation if the caller does not
> Peder> specify such a named variable.
>
> Peder> Then I can say
>
> Peder> if {[Tnm::mib defval <object> def]} {
> Peder> process $def
> Peder> }
>
> Peder> which is exactly what I want.
>
> I agree that throwing errors is not really a good idea. Another
> solution would be the addition of another command option which checks
> for the presence of a given construct, leading to code like:
>
> if {[Tnm::mib check <object> defval]} {
> process [Tnm::mib defval <object>]
> }
>
> The downside of this approach is that it requires to invoke two Tnm
> commands where your approach only needs one. The advantage is that
> there are no changes to existing Tnm::mib command options.
>
> I actually think that your proposal is the better solution, but it
> will take more time to implement, document and test your solution.
>

I agree with you on both assertions in this last paragraph :-)

so the decision is really just for you to make. I can live very well with
both solutions.

best regards
--peder chr.

Peder Chr. Nørgaard System Developer, M. Sc.
Telebit Communications A/S tel: +45 86 28 81 77 - 49
Fabrikvej 11 fax: +45 86 28 81 86
DK-8260 Viby J Denmark e-mail: pcn@tbit.dk

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.