Documentation > Migrating from PST v1.5 to PST v2.0a for Squeak
 
  • How to Migrate Projects from PST v1.5
  • We provide a mechanism to allow users of PST v1.5 to migrate to v2.0a.  Version 2.0 supports the reading of the package files from 1.5. These can be read by evaluating:

    PstSqueakTools pstProjectFileIn: 'your filename here'

    When you file in your code, there may be cases where Squeak will notify you of a syntax error.  You will need to get an editor on the file and fix the error in the file and save it.  Once the change is made, re-attempt the above expression.  Do this until your code files-in completely.

    There are a few semantic changes as well.  We explain these here.

    Constants

    Version 2.0 no longer supports the ##constantName syntax.  There is also no longer a Constants Browser.  Instead, what needs to be done is to define a subclass of PoolDictionary, and to place accessors for the values on the class side of this new class.  The new class should be named somewhat close to what the constant category that you used in the 1.5 version.

    Reading a 1.5 project into a 2.0 environment will automatically do the translation for you.  Any methods with references to constants will have their source modified to match the new way of doing things.  For example:

    self scroll: ##upDirection

    Will look like

    self scroll: PalmOsUIConstants upDirection

    There will be a class created whose name will correspond to the name of the constant category you had originally used.  And methods will be defined on the class side that will return the value you specified.

    The reason for getting rid of the way constants was done, was in order to stay closer to the standard syntax of Smalltalk.  Plus, this is a much cleaner way of doing this anyways.  Not all constants are done this way.  One drawback currently, is that access to this constants now requires a message send.  Although this is true now, the next version of the compiling will support inlining of methods, and therefore this overhead will disappear.  Not only that, but the inlining will work for general code as well, and possibly provide for even more benefit.  More information to come when this feature is ready.

    The System Properties constants are no longer needed.  Instead, there is a special class called PstPalmSqueakPackageSpecification that is used for these.  The specification of the application name, stack size and all that is now contained in code of a class.  This makes things much easier to handle.

    Hard Assign

    Some of you may not realize that Pocket Smalltalk allows the storing of values into an argument of a method.  This was done using the ::= syntax.  This is now gone.  There may be some issues with this, but none have been encountered so far.  The only issue you may run into, is that the original core.st has one method that uses this.  You MUST replace this method with

    Application classMethod!
    showFor: instance

    | currentInstance temp |
    currentInstance := instance.
    Form gotoForm: self formID.
    [currentInstance isNil] whileFalse: [
        self consumeExcessEvents.
        currentInstance create.
        currentInstance handleLastEvent.
        currentInstance eventLoop.
        temp := instance nextToRun.
        currentInstance nextToRun: nil. "clear forward reference"
        currentInstance := temp].

    This method may still need some work, but we will let you know if it does.

    If you have created any methods that use this, you will need to manually go into the project file and make this methods not need this operator.

    Creating the .PRC file

    There used to be a menu option to generate .PRC file, as well as constants in order to build an application to be run on a Palm device, or the Palm emulator.

 

Last updated: Dec 7, 2001

Palm Powered is a trademark of Palm Inc. Pocket Smalltalk is trademark of Pocket Smalltalk Group. Copyright (c) 1998 - 2001 Pocket Smalltalk Group.