CS 535 Object-Oriented Programming
Spring Semester, 2003
© 2003, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 28-Jan-03
Tuesday February 4
The VisualWorks home is the directory containing the VisualWorks bin and image
directories. On Rohan this is /opt/smalltalk/vw7nc. What is your VisualWorks
What directory is your version of VisualWorks using as the VisualWorks home?
(Look at the “File” menu in the Launcher.)
Open a System Browser and find the String class. Look at the method
runLengthFor: in the accessing protocol. Now change the VisualWorks home
setting so it is not correct. Then deselect and reselect the method
runLengthFor: in the fourth list pane from the left in the System Browser. What
happens? Now set the VisualWorks home to the correct value and deselect and
reselect the method runLengthFor:. What happens?
Which Launcher menu contains an item to allow you to find implementations of a
Which class(es) implement the method nextPutAll: ?
Which Launcher menu contains an item to allow you to find the senders of a
Which method(s) send the message useSmallPaletteAlgorithmFor: ?
Add the following method to the String class in converting protocol category.
^self , self reverse
is printed when you evaluate the following expression in a workspace using
Exit VisualWorks and save the image as CS535. You should now have two images
with different names: CS535.im and visualnc.im. Start VisualWorks with the
image visualnc.im and search for the method asPalindrome in the String class.
Can you find it? Exit VisualWorks and start VisualWorks with the image CS535.im
and search for the method asPalindrome in the String class. Can you find it?
When you find the method asPalindrome file it out using the “File Out
as...” item in the “Method” menu of the System Browser. Use
the VisualWorks File Browser to open the file you just saved. What is the first
line of the file?
Open the settings window by selecting the “Settings” item in the
“System” menu of the Launcher. Find the “File-out Type”
tab (it is near the bottom of the window, you may have to enlarge the window or
“scroll” the window to see it). Change the file-out format to
Smalltalk chunk source code. Now file out the method asPalindrome again. What
is the first line of the file now?
Modify the size method in the Integer class to return the number of digits in
the receiver. Turn in a copy of your method.
Copyright ©, All rights reserved.
2003 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.
visitors since 28-Jan-03