CS 535 Object-Oriented Programming
Fall Semester, 2003
© 2003, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 05-Sep-03
Thursday September 11
Read the Introduction lesson in the Lesson Runner to learn about VisualWorks
home directory. To run the Lesson Runner in the “Help” menu of the
launcher select the “Lesson Browser” item. What is your
VisualWorks home directory?
What directory is your version of VisualWorks using as the VisualWorks home?
Open a System Browser and find the String class. Look at the method
concreteIndexFor: in the accessing protocol. Now change the VisualWorks home
setting so it is not correct. Then deselect and reselect the method
concreteIndexFor: 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 concreteIndexFor:. What happens?
Which Launcher menu contains an item to allow you to find implementations of a
Which class(es) implement the method raisedTo: ?
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 Character class in accessing category.
^(self asInteger + 1) asCharacter
is printed when you evaluate the following expressions in a workspace using
'abc' collect: [:each | each next]
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 next in the Character class. Can
you find it? Exit VisualWorks and start VisualWorks with the image CS535.im and
search for the method next in the Character class. Can you find it?
When you find the method next in the Character class 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. Select “Source in the tree
view on the left. Change the file-out format to Smalltalk chunk source code.
Now file out the method next in the Character class again. What is the first
line of the file now?
source code printed out in XML Format is not accepted when turning in
Modify your Character>>next method so that:
$z next returns $a
$Z next returns $A
all other cases the Character>>next method should return the same value
as the one given in problem 4. Turn in your source code for the 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 02-Sep-03