Re: a typeof command for debugging?

Liste des GroupesRevenir à cl tcl 
Sujet : Re: a typeof command for debugging?
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tcl
Date : 22. Jun 2025, 12:08:53
Autres entêtes
Message-ID : <yga34bsav96.fsf@akutech.de>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* Mark Summerfield <m.n.summerfield@gmail.com>
| I've incorporated that but I still have an actual bug. The catch always
| returns false (failed) so objects always get returned as list_or_str. Yet,
| if I use info object class directly it correctly returns the class name.
| So clearly I'm doing something wrong in the catch.
>
|     proc typeof x {
|         # puts "\n[tcl::unsupported::representation $x]"
|         if {![catch {[info object class $x] name}]} {
|             return $name

This looks suspicious: you are calling
  [info object class $x]
and whatever that returns, you use as a command to call with argument 'name',
and discard the result.  The variable $name should not be set when you hit
the return.

Did you rather mean

  catch {info object class $x} name

?
R'

Date Sujet#  Auteur
21 Jun 25 * a typeof command for debugging?8Mark Summerfield
21 Jun 25 `* Re: a typeof command for debugging?7Christian Gollwitzer
21 Jun 25  +- Re: a typeof command for debugging?1Christian Gollwitzer
22 Jun 25  `* Re: a typeof command for debugging?5Mark Summerfield
22 Jun 25   +* Re: a typeof command for debugging?2Ralf Fassel
22 Jun 25   i`- Re: a typeof command for debugging?1Mark Summerfield
22 Jun 25   `* Re: a typeof command for debugging?2Christian Gollwitzer
23 Jun 25    `- Re: a typeof command for debugging?1Christian Gollwitzer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal