[squeak-dev] Re: Transform sends to ANSI standard?

Benoit St-Jean benoit.stjean at gmail.com
Tue Sep 25 22:35:14 UTC 2012

On 25/09/2012 2:31 PM, Hernán Morales Durand wrote:
> Hi folks,
> I am rewriting packages to be compatible or more portable between
> Smalltalks. Code Critics gives the following information on my packages:
> - #cr, #crlf, #lf, #space, #tab, #findTokens:, ... are not part of the
> ANSI string protocol.
> - #cr and #lf are not part of the ANSI stream protocol.
> - The ANSI standard does not support #asInteger and #asString on Object.
> - Some collection methods are not ANSI compatible: #pairsDo:,
> #collect:thenDo:, #reject:thenDo:, #detectSum:, #valuesDo:,
> #keysSortedSafely, #new:withAll:, etc.
> Does anyone have an idea on how to transform those sends to be ANSI
> compatible?

Hi Hernan,

I don't think being ANSI-compatible should be a goal in any case.  You 
won't find any Smalltalk flavor (commercial or Open Source) that is 
fully ANSI-compatible.  All vendors have their 
extensions/exceptions/versions.  Just have a look at Glorp to convince 
yourself of differences between Smalltalk implementations!

But if your goal is portability, I'd say you should start by having your 
code compatible with VAST, VW, Dolphin & Squeak.  You'll probably cover 
most of other Smalltalks variants by doing so.  The ANSI standard was 
never, to my knowledge, 100% fully respected by any Smalltalk vendor. 
Most of them tried to but none of them implemented it with 100% 
compliance.  In other words, just do your best at satisfying 
compatibility with the most vendors.

This one uses Xtreams, the other one Nautilus browser or Zinc, the other 
one starts Array indices at 1, this other one does this, the other one 
does that, one uses Smalltalk while the other uses SmalltalkImage, etc.

Unfortunately, we're not in the Java world.  You'll eventually need a 
Bundle/Application/Project/Package named "Portability" just like 
everyone else...

More information about the Squeak-dev mailing list