This chapter describes changes and new features important for programmers using GemStone Smalltalk, including:
Changes in Classes, compilation, and code management
Changes in Numeric/Time classes
Other Changes and Enhancements
Deprecated and removed classes and methods
Previously, instance variable names were limited to 64 characters; this has been increased. Now, class names, instance variable names, class variable names, class instance variable names, method temporaries, and method arguments all have a limit of 1024 characters.
The Array literal forms #( element1 element2 ...), previously could embed most other literal kinds with the exception of literal ByteArrays #[ int1 int2 ...]. Now, ByteArrays can also be embedded.
For example, this is now legal:
#( #[1 2 3 4] 'test' 1 2.0 )
The compiler cannot inline blocks under some conditions, when the blocks are complex. Previously, this resulted in Warnings, such as "WARNING: at line 21, to:do: not optimized". These Warnings were not useful and are no longer produced.
Historically, on login a copy of the UserProfile’s symbolList is made available as the transient symbolList, and the transient symbolList is then used for all lookups for classes and other variables. This allows a separation between the shared symbolList for that UserProfile, and any changes the user is making while logged in. The transient symbolList was kept in session state, and was not affected by commit or abort. If there were changes in the UserProfile’s persistent symbolList (made by other sessions), a session’s transient symbolList did not automatically pick these changes up on commit or abort.
In 3.6, this behavior has been modified to make it easier to keep the transient symbolList in sync with the persistent symbolList.
Now, on login, the transient symbolList is a reference to, not a copy of, the persistent symbolList. Applications that do not need to modify the transient symbolList will automatically pickup changes by commit or abort, without extra effort.
Executing any of the following methods will create a copy of the transient symbolList in session state. This results in the same behavior as in previous releases.
System class >> refreshTransientSymbolList
GsCurrentSession >> transientSymbolList: aSymbolList
GsCurrentSession >> transientSymbolList
GemStone Classes have a class category, which are not visible in GBS but are displays in tools such as Jade. There are a number of changes in the categories of classes in 3.6.
A method has been added to allow you to rename an instance variable in place, without versioning the class.
Note that this is not considered a safe operation. This is not intended for use in critical systems, or under production conditions. Use caution and perform thorough testing, since there may be unexpected consequences.
Class >> unsafeRenameInstVarNamed: oldName to: newName
Specials are kinds of objects in which the value of the object is encoded in the OOP itself, and thus do not require an entry in the object table, space on a data page, nor a fetch to fault into memory.
The following new Specials are subclasses of existing classes, and, like SmallDouble and Float, transparently interoperate to represent the most commonly used subsection of the full range of the superclass’s values.
SmallDates represents instances of Date; the SmallDate range covers all supported Dates.
Creating an instance of Date in the supported Date range will return an instance of SmallDate.
The technical requirement is that the year range is limited to -231 (-2147483648) to 231 - 1 (2147483647). The OOP uses 9 bits for an unsigned integer for the dayOfYear, and 47 bits for the 32 bit signed integer year.
A SmallDateAndTime is a DateAndTime representing a time (in microseconds) in the range of years 2001-2072, for times with offset from UTC (in hours) in the range -16..15).
Creating an instance of DateAndTime, when the result is in the range of SmallDateAndTime, will return an instance of SmallDateAndTime.
The OOP uses 5 bits signed offset from UTC in hours, and 51 bits of unsigned integer for the time since 2001 in units of microseconds.
SmallScaledDecimal is used to represent ScaledDecimals that have scale <= 31 and mantissa in the range -250 (-1125899906842624) to 250 - 1 (1125899906842623).
Creating an instance of ScaledDecimal, when the result is in the range of SmallScaledDecimal, will return an instance of SmallScaledDecimal.
The OOP uses 51 bits for a signed integer mantissa and 5 bits unsigned scale.
SmallTime is used to represent instances of Time as the local time since midnight in units of microseconds.
Creating an instance of Time, when the result is in the range of SmallTime, will return an instance of SmallTime.
The OOP uses 56 bits for an unsigned integer. The maximum value of local time is 86399999999.
To retain common behavior between the range of SmallDateAndTime and DateAndTime, DateAndTime has been adjusted. The following changes describe the behavior of instances of SmallDateAndTime as well as instance of DateAndTime.
Application extension methods that are added to DateAndTime, Date, Time, or ScaledDecimal may directly reference instance variables on that class; this is normal, and these methods will compile correctly. However, these methods are problematic when inherited by SmallDateAndTime, SmallDate, SmallTime, and SmallScaledDecimal, since specials by definition do not have instance variables.
If you have added methods directly to GemStone kernel classes DateAndTime, Date, Time, or ScaledDecimal, you must review your code and ensure that any direct accesses to instance variables are changed to use accessor methods. Methods with direct instance variable references will compile correctly, but will get Error 2710/instVar access not allowed in a special object on execution. Methods with direct references that are not recompiled will cause the Gem to crash.
Time >> asMicroseconds
Returns a SmallInteger that represents the receiver in units of microseconds since midnight, local time.
Time >> subtractMilliseconds: anInteger
Returns a Time or SmallTime (in practice, a SmallTime) that describes a time of day anInteger milliseconds earlier than that of the receiver.
Time class >> fromMicroseconds: anInteger
Create an instance of Time or SmallTime (in practice, a SmallTime) that is anInteger microseconds since midnight, local time.
The class GsTsExternalSession was added in v3.5.3. GsTsExternalSession uses the thread-safe GCI (gcits.hf), rather than the traditional GCI interface (gci.hf) that is used by GsExternalSession.
In this release, GsTsExternalSession has been associated with GsExternalSession under a common superclass, with adjustments to the API to improve the ability to move between these classes.
In addition, the class GsTsX509ExternalSession has been added, which allows X509-secured external sessions using the thread-safe GCI.
AbstractExternalSession
GsExternalSession
GsLegacyExternalSession
GsX509ExternalSession
GsTsExternalSession
GsTsX509ExternalSession
GsExternalSession is now legacy; new code should use GsTsExternalSession. GsExternalSession may have issues in complicated environments with multiple threads.
The overhead of making calls using GsTsExternalSession is 1/2 to 1/4 the overhead required by calls to GsExternalSession.
GsTsExternalSession is now a subclass of AbstractExternalSession, and a number of methods are now implemented in the superclass.
In addition, many new methods have been added to make the transition between GsExternalSession and GsTsExternalSession more transparent.
GsTsExternalSession >> gemNRS:
GsTsExternalSession >> hostPassword:
GsTsExternalSession >> hostUsername:
GsTsExternalSession >> password:
GsTsExternalSession >> stoneNRS:
GsTsExternalSession >> username:
GsTsExternalSession class >> gemNRS:stoneNRS:username:password:
GsTsExternalSession class >> gemNRS:stoneNRS:username:aUsernamehostUsername: hostPassword:
hardBreak
isRemoteServerBigEndian
nbLogin
nbLoginFinished
softBreak
stoneSessionSerial
waitForResultForSeconds:
waitForResultForSeconds:otherwise:
The method Object >> isSpecial can be sent to any object to determine if it is a special (the OOP encodes the value, such as a Character or SmallInteger). Historically, this method was overriden by Behavior >> isSpecial, which returned if instance of the class would be Specials, rather than the status of receiver itself.
The method Behavior >> areInstancesSpecial has been added, and should be used to test if instances of a class are Specials.
In v3.6, Behavior >> isSpecial has been removed, and the behavior is inherited now from Object. Sending isSpecial to Classes such as Character, which previously returned true, will now return false. Examine your application senders of isSpecial to ensure that this does not have unexpected results; change your code as needed to use areInstancesSpecial.
After an attempt to commit a transaction fails, System class >> transactionConflicts returns the details of the commit failure. In addition to the previous possible return values, this may also now include #symbolFailure or #lockFailure.
The class ExitClientError has been added, allowing you to exit f rom a client process (usually topaz) with a specific error code.
topaz 1> run
ExitClientError
signal: 'Disallowed Operation'
status: 34
%
ERROR 3004 , a ExitClientError occurred (error 3004), , Disallowed Operation (ExitClientError)
Logging out session 1.
--- 08/11/2020 15:21:17.137 PDT Logging out
String search in ClassOrganizer (and via topaz) now searches the text of class comments, as well as method source.
The Arrays returned from methods to perform search were previously of size 2, the methods containing the search string and the offsets into these methods, are now are of size 3. The new third element is a list of classes whose class comment includes the search string.
ClassOrganizer>>substringSearch:
ClassOrganizer>>substringSearch:in:
ClassOrganizer>>substringSearch:in:ignoreCase:
The following methods are newly deprecated:
Class >> byteSubclass:classVars:classInstVars:poolDictionaries:category:inDictionary:instancesInvariant:
Class >> indexableSubclass:instVarNames:classVars:classInstVars:poolDictionaries:category:inDictionary:instancesInvariant:isModifiable:
Class >> subclass:instVarNames:classVars:classInstVars:poolDictionaries:category:inDictionary:constraints:instancesInvariant:isModifiable:
DateAndTime class >> nowWithScale:
DateAndTime class >> setDefaultScale:
System class >> reclaimGemSessionIds
System class >> _deadNotReclaimed
The following classes were removed, and are now in Globals in the sub-dictionary ObsoleteClasses.
CanonicalStringDictionary
RubyBreakException
RubyCextData
RubyConstantRef
RubyHash
RubyProc
RubySocket
RubyThrowException
RubyTime
UnimplementedFloat1
UnimplementedFloat2
The following methods related to the previously deprecated, now removed find all reference paths feature have been removed:
Repository >> findAllReferencePathsToObject:
Repository >> findAllReferencePathsToObject:maxPaths:
Repository >> findAllReferencePathsToObjects:
Repository >> findAllReferencePathsToObjects:limitObjArray:printToLog:
Repository >> findAllReferencePathsToObjects:limitObjArray:printToLog:maxPaths:
Repository >> findAllReferencePathsToObjects:maxPaths:
Repository >> findAllReferencePathsToObjects:printToLog:
Repository >> findAllReferencePathsToObjects:printToLog:maxPaths:
Repository >> _findAllReferencePathsToObjects:limitObjArray:printToLog:maxPaths:
AbstractCharacter >> asJISCharacter
Behavior >> isSpecial
Character >> asJISCharacter
CharacterCollection >> asJISString
CPreprocessor >> defaultAix61Definitions
DecimalFloat class >> on:do:
GsObjectInventory class >> profileObjectsInBm:
GsObjectInventory class >> profileObjectsInFile:
Integer >> asJISCharacter
Object >> asEUCString
System class >> fastFindObjectsLargerThan:limit:
System class >> findObjectsLargerThan:limit:
The following private methods (including methods that were temporarily added during tonel code development) , have been removed:
AbstractDictionary >> at:ifPresent:
BlockClosure >> setPackage:withInMetacelloConfig:
CharacterCollection >> tonelSubstrings:
Class >> _newKernelSubclass:instVarNames:inDictionary:
Class >> _nonInheritedOptions
Class >> _optionsForDefinition
CLibrary >> _oneArgPrim:arg:
CLibrary class >> _oneArgPrim:arg:
Collection >> asMetacelloAttributeList
Collection >> setForDo:withInMetacelloConfig:
Collection >> setIncludesInMetacelloPackage:
Collection >> setLoadsInMetacelloProject:
Collection >> setRequiresInMetacelloPackage:
Collection >> sorted:
CPreprocessor >> _defaultAix61DefinitionsOld
CZstream class >> _initializeConstants
DateAndTimeANSI >> _secondsUTC:offset:
Dictionary class >> newFromPairs:
GciLibrary >> GciCHeapCheck
GciLibrary >> GciUtlExit_:
GciLibrary class >> initializeFunction_GciCHeapCheck_inLibrary:
GsBitmap >> _basicNew
GsBitmap >> _reportString
GsNMethod >> _debugInfoHasFileAndLine
GsNMethod >> _lineNumberBias
GsObjectInventory class >> _objInventory:waitForLock:pageBufSize:percentCpuActiveLimit:showHiddenClasses:aHiddenSet:listInstances:toFile:inMemoryOnly:
GsQuery class >> initialize
GsQueryFormula class >> initialize
GsQueryTokenParser class >> initialize
IO class >> new:mode:
IO class >> _forgetFileDescriptor:
IO class >> _rememberFileDescriptor:obj:
Object >> flag:
Object class >> fixReferencesAfterConversionFromDirectory:
ProcessorScheduler >> _endYield
ProcessorScheduler >> _findReadyProcess:
ProcessorScheduler >> _reapEvents:honorOob:
ProcessorScheduler >> _reschedule:
ProcessorScheduler >> _rescheduleHonorOob:
Repository >> _allReferencesByParentClass:
Repository >> _fastAllReferencesByParentClass:
Repository >> _primRestoreSecureBackups:scavPercentFree:bufSize:privateDecryptionKey:passphrase:numThreads:
Repository >> _restoreBackups:scavPercentFree:bufSize:numThreads:
SequenceableCollection >> writeStream
String >> addToMetacelloRepositories:
String >> asObsoleteSymbol
String >> execute:against:
String >> fetchRequiredForMetacelloMCVersion:
String >> loadRequiredForMetacelloMCVersion:
String >> mergeIntoMetacelloRepositories:
String >> packageFileSpecFor:
String >> recordRequiredForMetacelloMCVersion:
String >> removeFromMetacelloRepositories:
String >> resolvePackageSpecsNamedForMetacelloMCVersion:visited:ifAbsent:
String >> setIncludesInMetacelloPackage:
String >> setLoadsInMetacelloProject:
String >> setRequiresInMetacelloPackage:
Symbol >> asMetacelloAttributeList
Symbol >> asMetacelloAttributePath
Symbol >> setForDo:withInMetacelloConfig:
Symbol >> setForVersion:withInMetacelloConfig:
Symbol >> setPostLoadDoItInMetacelloSpec:
Symbol >> setPreLoadDoItInMetacelloSpec:
System class >> _breakSerialization
Time >> _initialize:
UserProfile >> _createDictionary:at:
UserProfile >> _renameDictionary:to: