Hi Everyone,
Lately, I have found a couple of things we can do in our Smalltalk development environment that make our work easier. I'm going to post two here in the hope that others will do the same, please. I'm sure there are things that we will all find valuable.
Back in November, with Seth's help, I figured out how to add pool dictionaries to workspaces, so I can play with code in a workspace without adding the pool to each reference.
EtWindow defaultEvaluationPools: (EtWindow defaultEvaluationPools asSet addAll: #(#PlatformFunctions #PlatformConstants)) asArray.
Yesterday, I came up with a way to create the source code for a method that needs to change from time to time and compile it into its class. Big picture: I have some apps that talk to host systems with old style fixed format messages. I created classes that define the layout of these messages and use #Symbols to name the fields. The problem is the packager generates warnings about these symbols. The solution is a #packagerKnownSymbols method that lists the symbols. This method doesn't change often but an automatic way of generating it, is helpful and kind of cool.
I can easily get the symbols from the classes, so I wrote a little code that creates the source for #packagerKnownSymbols in a stream and then executes:
MyBuffersApp class compile: stream contents.
I keep the code in the "Method Comment" of #packagerKnownSymbols, so it is readily available when needed.
Note: sending #class to the class saves the method as a class method, without #class it would be saved as an instance method.
Lou
--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/va-smalltalk/-/URYl3Nxju7kJ.
To post to this group, send email to
[hidden email].
To unsubscribe from this group, send email to
[hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.