Something curious

From: Giorgio Cesana <cesana_at_venus.sgs-thomson.it>
Date: Wed, 23 Aug 1995 14:31:18 +0200

Dear all,

I was trying to optimize a tool I have developed for my company when I observed
the following behaviour of STk (2.1.6, I tried to use the 2.2.0 but I cannot use
it becouse of the bug in the BLT drag & drop).

Let's simplify my test case:

> STk
Welcome to the STk...
STk> (set! *load-verbose* #t)
#[undefined]
STk> (require "Frame")
;; Loading file "/path/STk/STk/Frame.stk"
;; Loading file "/path/STk/STk/Basics.stk"
;; Loading file "/path/STk/STk/Tk-meta.stk"
;; Loading file "/path/STk/STk/stklos.stk"
;; Loading file "/path/STk/STk/hash.stk"
;; Loading file "/path/STk/SunOS-4.1-sun4m/hash.so"
;; Loading file "/path/STk/SunOS-4.1-sun4m/stklos.so"
"Frame"
STk> (require "Tk-classes")
;; Loading file "/path/STk/STk/Tk-classes.stk"
"Tk-classes"

Now if I try to require again "Frame" I get correctly:
STk> (require "Frame")
"Frame"

but if I try to use the Frame class I obtain:
STk> (make <Frame>)
;; Loading file "/path/STk/STk/Frame.stk"
;; Loading file "/path/STk/STk/Tk-methods.stk"
#[<frame> d8964]
THE FILE "Frame.stk" IS LOADED TWICE (the first time when requiring it, the
second when using the class).

Why this?

Unfortunately I have code that can be called in different ways so I cannot
suppress the two require (the problem is in the autoload mechanism, if a file
is already loaded -and the functions defined- when declaring a function with
autoload you will get a new load of the whole file when the function is used the
first time).

Any idea? Any fix?

Regards

Giorgio



-------------------------------------------------------------------------------

Giorgio Cesana | SGS-THOMSON Microelectronics
phone +39/39/603.6006 | Central R&D - DAIS
fax +39/39/603.5820 | via C. Olivetti, 2
e-mail giorgio_cesana.sgs-thomson.it | 20041 Agrate B.za (MI) - ITALY
Received on Wed Aug 23 1995 - 14:34:37 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST