Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
--------
Stephen Travis Pope Ojai, California, USA  http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
Hi Stephen --
#( ... ) is for literal arrays. { ... } is for object arrays. #[ ... ] is for byte arrays.
I think you want object arrays:
{(80 to: 90) . (60 to: 70)}
Best, Marcel
Am 04.01.2023 17:04:48 schrieb Stephen Travis Pope stephen@heaveneverywhere.com:
Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
--------
Stephen Travis Pope Ojai, California, USA pastedGraphic.tiffcid:55B397C7-3D20-4E60-A051-4564245235A7@sd.cox.net http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
Mille Grazie!
stp
--------
Stephen Travis Pope Ojai, California, USA  http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
On Jan 4, 2023, at 8:20 AM, Taeumel, Marcel Marcel.Taeumel@hpi.de wrote:
Hi Stephen --
#( ... ) is for literal arrays. { ... } is for object arrays. #[ ... ] is for byte arrays.
I think you want object arrays:
{(80 to: 90) . (60 to: 70)}
Best, Marcel
Am 04.01.2023 17:04:48 schrieb Stephen Travis Pope stephen@heaveneverywhere.com:
Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
Stephen Travis Pope Ojai, California, USA pastedGraphic.tiff cid:55B397C7-3D20-4E60-A051-4564245235A7@sd.cox.net http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
It may not be obvious from Marcel's example but you need the full-stop between each clause inside the {}. Forgetting it can result in 'interesting' debugging times. DAMHIKT.
On 2023-01-04, at 8:40 AM, Stephen Travis Pope stephen@heaveneverywhere.com wrote:
Mille Grazie!
stp
Stephen Travis Pope Ojai, California, USA <pastedGraphic.tiff> http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
On Jan 4, 2023, at 8:20 AM, Taeumel, Marcel Marcel.Taeumel@hpi.de wrote:
Hi Stephen --
#( ... ) is for literal arrays. { ... } is for object arrays. #[ ... ] is for byte arrays.
I think you want object arrays:
{(80 to: 90) . (60 to: 70)}
Best, Marcel
Am 04.01.2023 17:04:48 schrieb Stephen Travis Pope stephen@heaveneverywhere.com:
Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
Stephen Travis Pope Ojai, California, USA pastedGraphic.tiff http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Fractured Idiom:- POSH MORTEM - Death styles of the rich and famous
On Jan 4, 2023, at 8:04 AM, Stephen Travis Pope stephen@heaveneverywhere.com wrote:
Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
BTW, the correct terminology is “literal arrays”. “Immediate” is used to describe instances of SmallInteger, Character, and SmallFloat64, which are encoded directly in a tagged pointer, i.e. there is no “box” fir the object.
There was a change in the compilation of literal arrays from Smalltalk-80 v2 (blue book) to (a little before) the ANSI standard. Before, any unquoted string was interpreted as a Symbol, so #(nil true false) collect: [:t| t class] answered Array with: Symbol with: Symbol with: Symbol. The change was to interpret exactly these three unquoted strings as referring to the objects nil, true, and false. So now #(nil true false) collect: [:t| t class] answers {UndefinedObject. True. False}.
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
Stephen Travis Pope Ojai, California, USA
http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
Thanks for the clarification, Eliot!
stp
--------
Stephen Travis Pope Ojai, California, USA  http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
On Jan 4, 2023, at 8:59 PM, Eliot Miranda eliot.miranda@gmail.com wrote:
On Jan 4, 2023, at 8:04 AM, Stephen Travis Pope stephen@heaveneverywhere.com wrote:
Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
BTW, the correct terminology is “literal arrays”. “Immediate” is used to describe instances of SmallInteger, Character, and SmallFloat64, which are encoded directly in a tagged pointer, i.e. there is no “box” fir the object.
There was a change in the compilation of literal arrays from Smalltalk-80 v2 (blue book) to (a little before) the ANSI standard. Before, any unquoted string was interpreted as a Symbol, so #(nil true false) collect: [:t| t class] answered Array with: Symbol with: Symbol with: Symbol. The change was to interpret exactly these three unquoted strings as referring to the objects nil, true, and false. So now #(nil true false) collect: [:t| t class] answers {UndefinedObject. True. False}.
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
Stephen Travis Pope Ojai, California, USA
<pastedGraphic.tiff>
http://HeavenEverywhere.com http://FASTLabInc.com https://vimeo.com/user19434036/videos http://heaveneverywhere.com/Reflections
squeak-dev@lists.squeakfoundation.org