Re: Packages and Expect



Larry W. Virden wrote:
On Apr 29, 10:35 pm, "Tom Conner" <tcon...@xxxxxxxxxx> wrote:


Is there any way to "package require expect" so that I don't have to worry
about the path to the .so file?


Figuring out what kind of case that the developer used for an
extension is one of the challenges of the community. I tend to do
this:

$ tclsh
% package require Tryit
can't find package Tryit
% package require tryit
can't find package tryit
% package require TryIt
can't find package TryIt
% ^D
$ cd /path/where/I/Installed/tryit
$ less pkgIndex.tcl

and then I look to see if I can figure out what name is being used.
The ones that always get me are bwidgets (which for some reason is
BWidget) and tclx (which is Tclx, but which has the man page of TclX).




Hmm:

package require givdatnich
set whatwehave [ package names ]
set whatithinkiwant expect
set found [ lsearch -inline -regexp $whatwehave ***:(?i)$whatithinkiwant ]
puts stderr "required: $whatithinkiwant found : $found"
if {$found != {} } {
package require $found
} else {
puts stderr bahh
}

uwe
.



Relevant Pages

  • Tcl_Interp *shell questions
    ... which uses the Tcl C lib and threads without recompiling the Tcl lib? ... From the command line I can run package require Tclx yet from within ... the same command fails: ...
    (comp.lang.tcl)
  • Re: Extended tcl in 8.5.1
    ... I checked the lib folder and tclx8.4 folder is there, ... the required package for Extended tcl. ... If you have not previously needed "package require Tclx" then you must ...
    (comp.lang.tcl)
  • Re: How to make package names case insensitive
    ... While the OP's example did seem, to me, quite extreme, I have to admit ... that I've longed for Tcl to provide case insensitive behavior for ... package require, since I can never remember whether it is TclX, Tclx, ... so that I can look up the string for the package. ...
    (comp.lang.tcl)
  • Problem with TclX : TclX_CtypeObjCmd: UTF character longer than a int
    ... % package require Tclx ... tclsh>ctype ord \000 ... UTF character longer than a int ...
    (comp.lang.tcl)
  • Re: How to make package names case insensitive
    ... While the OP's example did seem, to me, quite extreme, I have to admit ... package require, since I can never remember whether it is TclX, Tclx, ... so that I can look up the string for the package. ...
    (comp.lang.tcl)