poolDictionary access in a Workspace

Torge Husfeldt torge.husfeldt at gmx.de
Tue Sep 9 18:22:36 UTC 2003


Hi Schwa,

On Tue, 9 Sep 2003 01:27:49 -0400, Joshua 'Schwa' Gargus 
<schwa at cc.gatech.edu> wrote:

> What do the rest of you do when you want to access values in
> SharedPools from a Workspace?  I have been adding the pools I'm 
> interested to UndefinedObject, but it feels like a hack.
>
> Poking around, it looks like we might let Workspace implement
> #doItContext and #doItReceiver to return objects that will magically
> result in the proper lookup when a workspace expression is compiled.
> The more I think about this, it seems like an even worse hack; at
> least the current one is simple.
>
> Then I thought about Workspace>>bindingOf:, but this doesn't even
> get called if you type in a name beginning with a capital letter.
Do you have any examples?
I'd like to hack away on this one but the examples i came up with
like #TextConstants are globals too, so they are found automatically.
How does one find sharedPools that are not globals.
...goes hacking in squeak
OK i got it.
This doIt gave me 42(!) PoolDictionaries that are not Globals.
| pools |
{String streamContents:[:strm |
	pools _ Association allInstances.
	strm nextPutAll: pools size printString;cr.
	pools _ pools select:[:ass | ass key class == Symbol].
	strm nextPutAll: pools size printString;cr.
	pools _ pools select:[:ass | ass key first isUppercase].
	strm nextPutAll: pools size printString;cr.
	pools _ pools select:[:ass | (Smalltalk at: ass key ifAbsent:[true]) == 
true].
	strm nextPutAll: pools size printString;cr.
	pools _ pools select:[:ass | ass value class == Dictionary].
	strm nextPutAll: pools size printString;cr].
pools}
... and also the insight that it is the bindings inside the pool dicts 
you're after.

>
> Does anyone have any other ideas?
>
> Joshua
>
>
I think the use of bindingOf: together with allowing the Parser to
ask for the binding og an uppercase varname is the most
straightforward hack.
I included a menu action for workspaces that adds all bindings from
a pool of the user's choice to it's internal bindings (one-way).
HTH,
Torge

-- 
Der Mensch kann wohl tun, was er will, aber er kann nicht wollen, was er 
will.
(Schopenhauer)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PoolsInWorkspace-th.1.cs
Type: application/octet-stream
Size: 4776 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030909/b8805bd0/PoolsInWorkspace-th.1.obj


More information about the Squeak-dev mailing list