I'd guess it was just a nod to the rest of the world.
There are a lot of peeks in a lot of stream implementations out there, and pretty much all of them leave the result in the stream.
When I see peek in the name of a stream operation, my hindbrain reads it as non-consuming.
Sometimes there are peeks that alter the stream - operations that consume everything up to - but not including - a sought-after character.
But the thing you're peeking at is unaffected; that's a very common convention about what the word 'peek' conveys in the name of a stream operation.
- b
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