[BUG][FIX] DeclarativePools

Tim Rowledge tim at sumeru.stanford.edu
Fri Jun 6 01:57:43 UTC 2003


"Andreas Raab" <andreas.raab at gmx.de> wrote:

> To be honest, I don't see the problem. For those pools which are effectively
> managed by the system (e.g., TextConstants, GZipConstants, ZipConstants etc)
> any attempt to replace them in Smalltalk would *rightfully* raise an error
It doesn't seem to in my latest image; 'Smalltalk at: #TextConstants
put: Dictionary new' works just fine. It doesn't break any _compiled_
code of course because the old associations are still there but any code
compiled after that will get the new (if any) association. IFF the
SharedPool classes were protected in ReadOnlyBindings we'd get an error
(I just tested by using
| readOnly readWrite |
readWrite _ (SharedPool withAllSubclasses asArray collect:[:cl| cl name]) collect:[:s| Smalltalk associationAt: s].
readOnly _ readWrite collect:[:x| (ReadOnlyVariableBinding key: x key value: x value)].
readOnly elementsExchangeIdentityWith: readWrite.
to confirm it still works ok) and can do whatever; if people are ok with
it simply being an Error that's fine with me.


> (think about what would happen if the pool has evolved and you try to file
> in an older version).
That's one of the things that makes me dislike the current code -
terrible opportunity for corruption.

[snip]
> So for the "system" set of pools I feel pretty safe as long as we don't
> touch TextConstants too early on.
I agree that we're pretty safe but, spank my whippet and call me Granny,
I worry about these possibilities.  Thinking of TextStyle - yuck. So
much ugly code relating to use and abuse of TextStyles. Boy does that
stuff need cleaning up.

[snip]
> > As a rather different way of handling this, perhaps it is worth
> > reconsidering an earlier plan we discused, that of using classes to
> > _define_ the pools rather that _be_ the pools. 
> 
> Na. Break those eggs! They stink anyway!
I agree in general. Stinky eggs need throwing out.

> I don't see neither a dead-end nor a problem here. Show me a couple of
> practical examples of the problems you see (we've got roughly 250 packages
> on SqueakMap) and if you find more than two let's talk about it again.
Well, the first one I can think of doesn't simplistically use the
'Smalltalk at:#FooDict put: Dictionary new' incantation but it does
result in the pool being made as a Dictionary and filling it in. You
probably know of it; it's called Balloon3D.sar :-)

Nonetheless I think I agree mostly that it is probably worrying too much
to obsess on this. Perhaps I'll write-protect the 'system' pools and let
the rest look after themselves for now.

tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
APL is a write-only language.  - Roy Keir



More information about the Squeak-dev mailing list