D5.1 Buglet -- Packaged globals loaded after their referrers?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

D5.1 Buglet -- Packaged globals loaded after their referrers?

RT Happe
[I'm a neophytic Dolphin user, so please bear with my mistakes.]

When I package a class referring to a previously uncommitted pool
dictionary and the latter itself, save the package, and install
it in a fresh image, the system complains about undeclared '...'
and flags the method referencing a pool variable with a red cross.
When I then accept the red method, it turns annular-green and
works.

Apparently, the package installer loads globals after the
methods using them (i.e. in the order I added things to the
package ...), and the system doesn't appreciate.

Here is the detailed procedure exposing the supposed bug:
* Create a new package.
* Create a dictionary, add an entry, and assign it to a new global.
* Create a class listing that dictionary in its poolDictionaries.
* Add a method to the class using a pool variable (from the new pool).
* Drag the class to the new package.
* Add the pool dictionary to the package's globals.
* Save the package.
* Install the package into a fresh image.

Then, the system transcript will show something like
    Error: Pulitzer>>answerGlobal at line 2: undeclared 'glorp'
And so on.

rthappe


Reply | Threaded
Open this post in threaded view
|

Re: D5.1 Buglet -- Packaged globals loaded after their referrers?

Blair McGlashan
"RT Happe" <[hidden email]> wrote in message
news:[hidden email]...

> [I'm a neophytic Dolphin user, so please bear with my mistakes.]
>
> When I package a class referring to a previously uncommitted pool
> dictionary and the latter itself, save the package, and install
> it in a fresh image, the system complains about undeclared '...'
> and flags the method referencing a pool variable with a red cross.
> When I then accept the red method, it turns annular-green and
> works.
>
> Apparently, the package installer loads globals after the
> methods using them (i.e. in the order I added things to the
> package ...), and the system doesn't appreciate.
>...

This is because (I suspect) you have used a normal Dictionary for the pool.
Although the class builder will accept a Dictionary as a pool, it is
necessary to use either a PoolDictionary or a PoolConstantsDictionary.

As far as the compiler and execution machinery are concerned, a standard
Dictionary is acceptable, however the package system relies on specialised
behaviours of Pool[Constants]Dictionary to support fully textual packages,
change tracking, etc. Also if your pool contains only constants (we think
the the only acceptable use of pools), then the compiler will generate more
efficient code if a PoolConstantsDictionary is used.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: D5.1 Buglet -- Packaged globals loaded after their referrers?

Christopher J. Demers
"Blair McGlashan" <[hidden email]> wrote in message
news:bbhmd1$9ktuc$[hidden email]...
> "RT Happe" <[hidden email]> wrote in message
> news:[hidden email]...
> >...
> > Apparently, the package installer loads globals after the
> > methods using them (i.e. in the order I added things to the
> > package ...), and the system doesn't appreciate.
> >...
>
> This is because (I suspect) you have used a normal Dictionary for the
pool.
> Although the class builder will accept a Dictionary as a pool, it is
> necessary to use either a PoolDictionary or a PoolConstantsDictionary.
>
> As far as the compiler and execution machinery are concerned, a standard
> Dictionary is acceptable, however the package system relies on specialised
> behaviours of Pool[Constants]Dictionary to support fully textual packages,
> change tracking, etc. Also if your pool contains only constants (we think
> the the only acceptable use of pools), then the compiler will generate
more
> efficient code if a PoolConstantsDictionary is used.

I wonder if this would be worthy of a warning (perhaps in D6).  It seems an
easy mistake to make.  I don't make PoolDictionary's very often and I may
forget this info. ;)

Chris