PositionnableStream>>peekFor: not standard

nicolas cellier ncellier at ifrance.com
Wed Feb 28 22:06:14 UTC 2007


James Foster a écrit :
> Actually, in this case I'd suggest that we change the standard! In each of
> the six Smalltalk dialects I have available (Dolphin, GemStone, Squeak,
> VisualAge, VisualSmalltalk, VisualWorks) the following returns true:
> 
> 	((ReadStream on: 'abc') peekFor: $a; next) = $b.
> 
> This makes some sense. If you get back what you expect, why ask for it
> again?
> 
> Is there an ANSI errata? If not, could we have a wiki page available for
> such? I have several things to add...
> 
> James Foster
> 

Totally agree, change ANSI

peekFor: does peek, and advance if character (or any object) matched.
1) This covers 99% of our needs.
2) If we start periphrasing like peekAndAdvanceIfEqualTo: our small talk 
will fast become longish and boring. (Why not doWithEveryElement: 
instead of do: etc...)

Nicolas




More information about the Squeak-dev mailing list