Bug 45892

Informational

GemStone/S 64 Bit

3.4.1, 3.4, 3.3.5, 3.3.4, 3.3.3, 3.3.1, 3.3, 3.2.16, 3.2.15, 3.2.14, 3.2.13, 3.2.12, 3.2.11, 3.2.10, 3.2.9, 3.2.8.1, 3.2.8, 3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2, 3.1.0.6, 3.1.0.5, 3.1.0.4, 3.1.0.2, 3.1.0.1, 3.1, 3.0.1, 3.0

All Platforms

Syntax errors due to GemConvertArrayBuilder setting during upgrades / file-ins / compiles

In GS/64 3.0, the syntax for Array constructors was changed from using square brackets with commas (for example: #[a, b, c] ) to using curly brackets with periods (for example: {a . b . c} ).  This was done to avoid conflicts with the use of square brackets for ByteArray constructors (for example: #[1 2 3] ) for compatibility with other Smalltalks.

The System configuration parameter  #GemConvertArrayBuilder was introduced to inform the compiler to treat #[ ... ] as a pre-3.0 Array constructor and to compile it accordingly.  But note that this will cause problems if processing post-3.0 code containg #[...] ByteArray constructors.

For example, if compiling code using the pre-3.0 Array constructor #[a , b, c], and #GemConvertArrayBuilder is incorrectly set to nil/false, a compiler error similar to the following will be generated:

 GemStone Smalltalk Compiler Errors:
   #[a, b, c]
 * ^1 ^2 *******

1: [1035] expected a right bracket (]) 2: [1034] unexpected token


Inversely, if compiling post-3.0 code containing the ByteArray constructor #[1 2 3] and #GemConvertArrayBuilder is incorrectly set to true, a compiler error similar to the following will be generated:

 GemStone Smalltalk Compiler Errors: #[1 2 3]
 * ^1
******* 1: [1034] unexpected token 


When compiling code (for example, during upgrades or file-ins) be aware of which type of constructor is used in the source code and make sure that #GemConvertArrayBuilder is set accordingly. In general this means that for pre-3.0 code #GemConvertArrayBuilder should be set to true, and for post-3.0 code the parameter can be left unset or set to false/nil. If not correctly set, compiler errors will be generated on any #[ ] constructors.

Workaround

Make sure #GemConvertArrayBuilder is set properly (true for pre-3.0 code, unset/nil/false for post-3.0 code).


Last updated: 12/11/15