I must give Perl it’s due: amok it may be, but @INC is there.
There is a post at Artima’s Agile Buzz by Cincom VisualWorks’ Jim Robertson on how to load the code for BottomFeeder into a VW Smalltalk 7.5 image (an aggregated source code file, if you will – Smalltalk is not file-based in the way C++ is file-based or the way java packages are file and directory hierarchy-based).
In my case that meant running
I:\vw7.5nc\image>..\bin\win\visual.exe visualnc.im -filein ..\scripts\build-bf-dev.st
The first thing you notice is that dialogs pop-up to request permission to re-load what is already loaded, so we are far from the typical command line for a programming language. That may sound unfair to Smalltalk, but console applications are an important way to salvage legacy Smalltalk code …
Then the whole thing fails when an XML file is not found.
Here are 2 tips.
If you use the non-commercial VisualWorks you will be using the public repository for code, called Store. When you connect to that repository there is no obvious way to save your connection profile. But you must save it and it must be named
cincomsmalltalk
which is not the default nor offered as a default. One way to do this is to arbitrarily flip the string for the user name from ‘guest’ to ‘guest2′ which triggers an enable on the SAVE button. Save. Now flip back to guest. Save again.
Step two. Open a workspace and DO IT on
Store.RepositoryManager open
and save that ConnectionProfile with an EXPORT. Naturally I wanted to save it with my script in my new .scripts directory. But you might naturally save it in the VW home directory. Forget where that is? Open
the System Transcript menu and check. Ah. Exit. Run script from command line.
Ka-boom! Busted agin. And so here Perl gets its due. Perl has @INC which gives you a good shot at finding files much the same as C
Check my command line. I am in the ./image directory which is the execution path so that is where the ‘repositories.xml’ file must reside.
Now some Smalltalk evil. I move the file. I add a space character to a comment and ACCEPT. Away we go. Why evil? I just changed a method to trick Smalltalk. And not just any method. A public method in a base class. But that is another subject.
Now to get intimate with BottomFeeder …
See my updated post here:
http://www.cincomsmalltalk.com/blog/blogView?showComments=true&printTitle=About_Building_BottomFeeder…&entry=3357193940
Which illustrates what you posted above.