Re: invalid command name



shady.abdelwahed@xxxxxxxxx wrote:
Hi All,

I have followed the example in the this link:

http://www.flightlab.com/~joe/gutter/doc/tcllib-1.8/interpolate.html


the script is as follows:

package require Tcl
package require struct
package require math::interpolate
set coeffs [::math::interpolate::prepare_cubic_splines {0.1 0.3 0.4
0.8 1.0} {1.0 2.1 2.2 4.11 4.12}]
foreach x {0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0} {
puts "$x: [::math::interpolate::interp_cubic_splines $coeffs
$x]"
}


but when i try to run it, i receive an error message that
the ::math::interpolate::prepare_cubic_splines and
the ::math::interpolate::interp_cubic_splines are invalid command
names.

why does that happen?

Because it appears there are some typos in the documentation. If you would do a [info procs ::math::interpolate::*] you will see that the "_" should really be "-".

Another way for you to have determined this was to take a peek at the code (it is all Tcl).

NOTE -- I've *never* used this package nor even looked at it until today. It took two minutes to figure out the problem. I point this out not to chide you, put rather to show you how you can "get moving again" faster some of the time.

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.



Relevant Pages

  • Tcl application deployment
    ... Tcl interpretator and any packages it uses. ... As far as I know, no OS provides way to load dynamic libraries using ... There is no way to fix bugs in some package used by application, ... all script files which come with application should be ...
    (comp.lang.tcl)
  • Re: Good debugger?
    ... The debugger is a Tcl script. ... need to add the package require for that extension. ... that the tcl that Tuba is using doesn't find a definition for an Expect ...
    (comp.lang.tcl)
  • Re: Cant access TCLLib when TCL is embedded in my application
    ... >> user does not use TCL interactively but just runs tcl files. ... > any broken installations. ... > That's really a bug in that package, but bugs happen, and so long as ... > all parts of the Tcl script library you will need. ...
    (comp.lang.tcl)
  • Re: Converting Iwidgets to Source
    ... > The problem I am facing is that I can't get my script to run ... My Linux Distrubutiondon't. ... has better support for Tcl packages. ... and I think debian has a good package ...
    (comp.lang.tcl)
  • Re: now do you "link" .tcl files?
    ... I think from the position of a newbie, this is how linking in Tcl ... At the time of the call, Tcl looks up the command named "foo" using ... pkgIndex.tcl for a Tcl-only package usually contains ...
    (comp.lang.tcl)