Re: Packages and Expect



Donal K. Fellows wrote:
Uwe Klein wrote:

package require givdatnich


You're doing this to initialize the package loading database? Unless you
already have such a package, you'll have a problem with it if you don't
wrap it in a [catch].
YES, i missed out on that.

proc loadwhatimean packname {
if {[catch {package require $packname } cerr ]} {
set whatwehave [ package names ]
set found [ lsearch -inline -regexp $whatwehave ***:(?i)$whatithinkiwant ]
puts stderr "required: $packname found : $found"
if {$found != {} } {
return [ package require $found ]
} else {
puts stderr bahh
# error or return -errorcode ..?
}
}
return $cerr

Donal.

uwe

.



Relevant Pages

  • Re: Error converting from UTF8 to ISO-8859-1
    ... package Button_Callback is new Gtk.Handlers.User_Callback ... pragma Suppress; ... Initialize routine of the dialog is: ... function compiles without errors. ...
    (comp.lang.ada)
  • Re: Extending existing methods of base classes and Loose Methods.
    ... So I changed the class definition and changed the class method ... initialize. ... this changes to my package. ... the package scripts are a good place for this. ...
    (comp.lang.smalltalk.dolphin)
  • Re: passing a Factory to a method to create a generic instance
    ... IOStream ios = new FileIOStream; ... a.assignmentLoadis supposed to initialize the object, completely, from the data read from ios. ... Read a token from the stream, associate that token with a class, instantiate the class with newInstance. ... >> constructors, then make the factory object part of the package, so it ...
    (comp.lang.java.programmer)
  • Re: Initializers
    ... 'constructor' to Ada packages maybe? ... the things they do Ada reference manual calls "package ... You can attach your code to elaboration in many ways. ... Initialize called etc. ...
    (comp.lang.ada)
  • Re: URLClassLoader problem with inner classes
    ... And then I have a class B extends A with a lot of inner ... static initialize function cause B is designed as a singleton. ... package, but have loaded the classes through different classloaders, then they ... It'll fail at runtime rather than ...
    (comp.lang.java.programmer)