[Newbies] Some general questions

subbukk subbukk at gmail.com
Wed May 23 10:52:38 UTC 2007


On Tuesday 22 May 2007 8:28 pm, Darren White wrote:
> Hello
>
> Is there a way to use a string as the name for a object? For example if I
> have the input string 'fred' from a user input field how do I create a
> object named userFred or even just fred?
Use asSymbol to convert string to symbol and use it in subclass: method:

BigBoss subclass: 'SmallBoss' asSymbol instanceVariableNames .....

> What is the difference between the source file and the image? Does the
> image use the code from the source file? If I create code dose it live in
> the image or source file?
The image is your Squeak computer.  If you open the System Browser, the last 
button in the bottom frame of System Browser is set to 'show source'. If you 
change it to 'bytecodes' you will see instructions for methods. If you set it 
to 'decompile', then bytecodes are converted to Smalltalk code, but you wont 
see comments or descriptive parameter names. With 'show source', the browser 
will pull out readable text from the Sources files.
Now if you are a programmer and make any changes to the displayed code, the 
changes are saved in 'changes' file. Open a 'simple change sorter' to browse 
through the changes. Now you can pick 'showDiffs' to see a pretty picture of 
what you have changed. Changes can be filed out into "change sets". These 
change sets can be filed into another image. The Squeak team aggregates such 
changesets and merges them to produce the next version of the Image and 
Sources files.

Squeak's smooth integration of toolchain makes it all appear so easy!

Hope this helps .. Subbu


More information about the Beginners mailing list