Re: What's the magic to using Incr Tcl




"Andrew Falanga" <af300wsm@xxxxxxxxx> wrote in message
news:1183129312.639497.34400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I've figured out that
I must use a "package require Itcl" in my script to load the
package.
however, then the interpreter bails saying that the command "class"
is
unknown. I've also tried "Class" although none of the examples in
this tutorial use an upper case C in the word class.

Andrew,

All of the itcl commands are kept in an "itcl" namespace. So, you'll
either have to reference them that way, as in:

itcl::class ...

or, you'll need to import them into your namespace, as in:

namespace import itcl::*

After that, this should work:

class ...

Jeff


.



Relevant Pages

  • Tcl 8.6 & IncrTcl...
    ... It seems that Tcl 8.6 & Itcl do not cooperate any more, so I am puzzled whether applications that use Itcl are upgradable to Tcl 8.6 :-( ... package require Itcl;# Itcl adds object-oriented facilities to Tcl. ... I know that I tried to use an Itcl namespace as a normal namespace (i.e. as expected by "Nub domain", but again tclsh crashes instead of returning an error. ...
    (comp.lang.tcl)
  • pkgIndex.tcl
    ... .tcl file does not ... package provide Navigation 1.0 ... namespace eval Navigation ... # "package ifneeded" command to set up package-related ...
    (comp.lang.tcl)
  • Re: How do I access ICTL on my WINDOWS 2000 box?
    ... I've been learning tcl/tk and now want to give ITCL a go. ... What do I add to my tcl scripts to get it to recognize my class definitions? ... To now go ahead with ITCL, is it just a matter of adding a "package require" command ...
    (comp.lang.tcl)
  • Re: Putting a binary extension in a namespace
    ... Once a command is exported from its origin namespace, ... package require myPkg ... It always evaluates any "package ifneeded" script in ...
    (comp.lang.tcl)
  • Re: Core commands as ensembles...
    ... command itself because I kept getting errors when trying to rename the ... namespace commmand. ... This package can turn an entire namespace into an ... ensemble, it can add and remove commands from ensembles. ...
    (comp.lang.tcl)