[BUG] Class PositionableStream - Method isEmpty

Richard A. O'Keefe ok at atlas.otago.ac.nz
Tue Feb 19 02:07:09 UTC 2002


Fernando Embrioni <feremb at yahoo.com> wrote:
	   | example |
	   example := ReadStream on: #('uno' 'dos' 'tres').
	   example isEmpty --> true
	
If you want to tell whether more data is available from this stream,
	   example atEnd --> false
is what you want.

	isEmpty
	    "Answer whether the receiver's contents has no elements."
	    ^position = 0
	
The method body would make sense if the method were called
#atStart.  For the given name and comment, I'd expect
	    ^collection isEmpty

Other uses of isEmpty in the system really do seem to test whether an
entire collection is empty, whatever the position in it might be.

	PD: Can someone tell me where is the method for
	"basicNew" implemented?
	
Open method finder, type basicNew in top left panel, Cmd-s accept,	
click on basicNew in middle left panel, see Behavior, Integer class,
and SmallInteger class in right panel, click on Behavior, see	
	
Kernel-Classes/Behavior/instance creation/basicNew
    "Primitive.  Answer an instance of the receiver (which is a class)
     with no indexable variables.  Fail if the class is indexable.
     Essential.  See Object documentation whatIsAPrimitive."
    <primitive: 70>
    ...




More information about the Squeak-dev mailing list