[squeak-dev] List of all global variables? (Environments?)

H. Hirzel hannes.hirzel at gmail.com
Mon Apr 3 17:11:52 UTC 2017


Hello

The recipe: How to list all global variables [1]

has the code snippet



    Smalltalk keys
    select:
    [:k | ((Smalltalk at: k) isKindOf: Class) not]
       thenCollect:
      [:k | k -> (Smalltalk at: k) class]


to give a list of global variables.


When executing this code the recommendation is to use

    Smalltalk globals

instead of

    Smalltalk keys


A  rewrite because of Environments not having #select:thenCollect:  (I
do not think that is necessary) then is

    (Smalltalk globals select: [:k | ((Smalltalk at: k) isKindOf: Class) not])
       collect:  [:k | k -> (Smalltalk at: k) class]

Then I get 'key not found: ExtendedNumberParser'.

I wonder what is going on here ...

Regards
Hannes


[1] http://wiki.squeak.org/squeak/1824


More information about the Squeak-dev mailing list