From: SourceForge.net <no...@so...> - 2005-04-04 17:31:04
|
Bugs item #1176470, was opened at 2005-04-04 09:31 Message generated for change (Comment added) made by hobbs You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1176470&group_id=10894 Category: 39. Dynamic Loading Group: development: 8.5a3 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Erik Leunissen (eriklns) Assigned to: Kevin B KENNY (kennykb) Summary: Registration of [loaded] packages Initial Comment: L.S. Two unexpected results occur when importing packages which load compiled code: 1. When doing [package forget], the entry of the corresponding shared library is not removed from what's returned by [info loaded]. 2. After having done [package forget], and issuing again [package require], an error message is returned: "can't find package ..." An example session that exercises the above sequence for Tkhtml and Tktable is appended to this message. A discussion in c.l.t. (started at 4-Apr-2005, featuring Michael Schlenker, Don Porter and yours truly) arrived at the point where dgp judges there is either a bug here or a misfeature. Erik Leunissen ============== Example Tcl session: --------------- % info loaded {{} Tk} % package require Tkhtml 2.0 % info loaded {/usr/lib/tk8.4/../libtk8.4.so Tk} {/usr/local/lib/Tkhtml2.0/libTkhtml2.0.so Tkhtml} {{} Tk} % package forget Tkhtml % info loaded {/usr/lib/tk8.4/../libtk8.4.so Tk} {/usr/local/lib/Tkhtml2.0/libTkhtml2.0.so Tkhtml} {{} Tk} % package require Tkhtml can't find package Tkhtml % package require Tktable 2.8 % info loaded {/usr/local/lib/Tktable2.8/libTktable2.8.so Tktable} {/usr/lib/tk8.4/../libtk8.4.so Tk} {/usr/local/lib/Tkhtml2.0/libTkhtml2.0.so Tkhtml} {{} Tk} % info loaded {/usr/local/lib/Tktable2.8/libTktable2.8.so Tktable} {/usr/lib/tk8.4/../libtk8.4.so Tk} {/usr/local/lib/Tkhtml2.0/libTkhtml2.0.so Tkhtml} {{} Tk} % package forget Tktable % info loaded {/usr/local/lib/Tktable2.8/libTktable2.8.so Tktable} {/usr/lib/tk8.4/../libtk8.4.so Tk} {/usr/local/lib/Tkhtml2.0/libTkhtml2.0.so Tkhtml} {{} Tk} % package require Tktable can't find package Tktable -- end of message -- -- leunissen@ nl | Merge the left part of these two lines into one, e. hccnet. | respecting a character's position in a line. ---------------------------------------------------------------------- >Comment By: Jeffrey Hobbs (hobbs) Date: 2005-04-04 10:30 Message: Logged In: YES user_id=72656 This is clearly a misunderstanding on the part of the user. Maybe the docs need clarification, but it's not a bug. package forget forgets the 'ifneeded' part, which is of course why the next package require will fail. It does nothing else - it does not unload any packages. The 'info loaded' is still 100% correct, as those dlls are still loaded. You could still say 'load {} Tkhtml|Tktable' and they will load. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2005-04-04 09:48 Message: Logged In: YES user_id=80530 I'd have expected each [load] command to call the *_Init() routine again. That said, [package forget] is a rather specialized operation; not really meant for much use in programs. Avoid if possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1176470&group_id=10894 |