Let's say you have two classes, LuckyClass1 a subclass of the Object subclass and LuckyClass2 LuckyClass1 . And let your name be LuckyName . And let them say that you want to put your code in Lucky-Package1 .
Object subclass: #LuckyClass1 LuckyClass1 subclass: #LuckyClass2
LuckyClass1 class with instance side method luckyInstanceSideMethod1 , class side method luckyClassSideMethod1 and instance side variable luckyInstanceSideVariable1 and class variable LuckyClassSideVariable1 .
Similarly, the LuckyClass2 class with the luckyInstanceSideMethod1 instance luckyInstanceSideMethod1 method, the luckyClassSideMethod1 class side method and the luckyClassSideMethod1 additional instance luckyInstanceSideVariable2 variable and the LuckyClassSideVariable2 class LuckyClassSideVariable2 .
Method references will look like this:
LuckyClass1>>#luckyInstanceSideMethod1 LuckyClass1 class>>#luckyClassSideMethod1 LuckyClass2>>#luckyInstanceSideMethod1 LuckyClass2 class>>#luckyClassSideMethod1
On Linux / Mac OS X, run
vi Lucky-Package1-unix.st
to insert a file called Lucky-Package1-unix.st something like
Object subclass:
In fact, you can cut and paste the previous block.
Then convert line feeds to carriage returns, otherwise Pharo will complain. It is important. If you are running Linux / Mac OS X, you can use the following
cat Lucky-Package1-unix.st | tr \\n \\r > Lucky-Package1-pharo.st
On Windows, I will still use bash, vi, cat, tr from git -scm https://git-scm.com/download/win
Then the file in Lucky-Package1-pharo.st . It should appear in the Lucky-Package1 package in the system browser.