Re: Issue 2705 in pharo: Collection enh for Cog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

pharo

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


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

pharo

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.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

pharo

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])


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

pharo

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:


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

pharo
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


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

Levente Uzonyi-2
In reply to this post by pharo
On Mon, 20 Dec 2010, [hidden email] 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

Reply | Threaded
Open this post in threaded view
|

Re: Issue 2705 in pharo: Collection enh for Cog

Marcus Denker-4
In reply to this post by pharo

On Dec 20, 2010, at 4:10 PM, Levente Uzonyi wrote:

> On Mon, 20 Dec 2010, [hidden email] 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).


We will encounter (and fix) these things when we do the VM auto-build setup.
Maybe we then just load a pre-load for things like that.

        Marcus
--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.