STk 3.1 autoload bug

From: Rob DeLine <rdeline_at_cs.cmu.edu>
Date: Fri, 2 Aug 1996 13:31:01 -0400

There's a bug in STk 3.1 that has to do with provide/require versus
autoload. I don't have time to investigate it fully right now, but I
thought I'd warn the mailing list anyway. Here's a small program that
show's the problem:


(require "Canvas")
(define c (make <Canvas>))
(require "Tk-classes")
(format #t "~A\n" (is-a? c <Canvas>))


This program prints #f (false)! Because of a bug in autload, the file
Tk-classes.stklos causes the file Canvas.stklos to get loaded a second
time. This causes the class <Canvas> to get redefined, which makes is-a?
return false. To work around this problem, just load Tk-classes as early as
possible:


(require "Tk-classes")
(require "Canvas")
(define c (make <Canvas>))
(format #t "~A\n" (is-a? c <Canvas>))


This program correctly prints #t (true).

Rob DeLine
Received on Fri Aug 02 1996 - 19:34:07 CEST

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