moo/stix/kernel/Collection-Array.st

51 lines
615 B
Smalltalk
Raw Normal View History

#class(#pointer) Array(Collection)
{
#method size
{
^self basicSize.
}
2016-03-16 14:05:34 +00:00
#method ubound
{
^(self basicSize - 1).
}
#method at: anInteger
{
^self basicAt: anInteger.
}
#method at: anInteger put: aValue
{
^self basicAt: anInteger put: aValue.
}
#method first
{
2016-03-16 14:05:34 +00:00
^self at: 0.
}
#method last
{
2016-03-16 14:05:34 +00:00
^self at: (self ubound).
}
#method do: aBlock
{
2016-03-16 14:05:34 +00:00
0 to: (self ubound) do: [:i | aBlock value: (self at: i)].
}
2016-03-16 02:27:18 +00:00
#method copy: anArray
{
2016-03-16 14:05:34 +00:00
0 to: (anArray ubound) do: [:i | self at: i put: (anArray at: i) ].
2016-03-16 02:27:18 +00:00
}
}
#class(#character) String(Array)
{
}
#class(#character) Symbol(Array)
{
}