PositionnableStream>>peekFor: not standard

Ron Teitelbaum Ron at USMedRec.com
Thu Mar 1 00:57:35 UTC 2007


You know I still think it's wrong and should be implemented the way the
standard says.  Peek should peek regardless of how it is eventually used and
how all of the Smalltalk's implement it.  I can't be the only one that saw
it didn't work as expected and didn't use it because of that.  Notice that
there are few senders of peekFor: and lots of senders of peek even though
many of the senders of peek are really peek fors.  Seems like a me-too
implementation issue.

I'll give you that the uses of peekFor: in the parsers are very cleaver uses
of peekFor:  (ex. negative := peekFor: $-. ) and I do get how and why it's
implemented the way it is but I still won't use it.

I do agree, even though I won't use it, that it should be left the way it is
since it is consistent with all the other Smalltalks.  I wonder how many
other standards are not followed.  Did anyone check #isEmpty on
PositionableStream?

Ron Teitelbaum


> From: Andreas Raab
> Sent: Wednesday, February 28, 2007 5:23 PM
> 
> nicolas cellier wrote:
> > 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.
> >>
> >
> > Also add stx (Smalltalk-X) and gst (GNU Smalltalk) to the list.
> 
> I can't help but wonder how ANSI ended up with that definition if
> basically every Smalltalk in existence does it differently. Just one of
> those "design by committee" decisions? Or perhaps there is a good reason
> for it that just never made the light of the day? Mostly, the standards
> committee seemed to have gone with existing notions if there wide
> agreement on them - peekFor: seems to be one of those cases where the
> standard went wildly differently and I really wonder why.
> 
> Cheers,
>    - Andreas
> 





More information about the Squeak-dev mailing list