Re: [Pharo-project] Issue 2705 in pharo: Collection enh for Cog
Comment #2 on issue 2705 by marcus.denker: Collection enh for Cog http://code.google.com/p/pharo/issues/detail?id=2705 Next action: - take the code here and make a .cs or Slice out of it
Comment #3 on issue 2705 by renggli: Collection enh for Cog http://code.google.com/p/pharo/issues/detail?id=2705 The version in Pharo is called #reduce: and slightly slower, but also more general. In Pharo not only two-argument blocks are supported, but also blocks with more arguments. Furthermore, for sequenceable collections there are variations for left- (#reduceLeft:) and right-fold (#reduceRight:). I suggest to keep the Pharo versions.
Comment #4 on issue 2705 by stephane.ducasse: Collection enh for Cog http://code.google.com/p/pharo/issues/detail?id=2705 Thanks for your feedback. may be should just integrate + copyUpThrough: anElement + "Answer all elements up to and including anObject. If there + is no such object, answer a copy of the receiver." + + ^self first: (self indexOf: anElement ifAbsent: [^ self copy])
Comment #5 on issue 2705 by marcus.denker: Collection enh for Cog http://code.google.com/p/pharo/issues/detail?id=2705 I will add just copyUpThrough:
Updates: Status: Closed Comment #6 on issue 2705 by marcus.denker: Collection enh for Cog http://code.google.com/p/pharo/issues/detail?id=2705 12283
On Mon, 20 Dec 2010, pharo@googlecode.com wrote:
Comment #5 on issue 2705 by marcus.denker: Collection enh for Cog http://code.google.com/p/pharo/issues/detail?id=2705
I will add just copyUpThrough:
#fold: is sent by the Cog VMMaker code, so you either implement it, modify the Cog VMMaker code or you won't be able to build a Cog from a Pharo image (building such an image is a tedious task anyway). Levente
participants (2)
-
Levente Uzonyi -
pharo@googlecode.com