Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-07 Thread Mason Kramer
I just implemented Bag to the point where it passes the spectests. (https://github.com/masonk/rakudo/commit/2668178c6ba90863538ea74cfdd287684a20c520) However, in doing so, I discovered that I'm not really sure what Bags are for, anymore. The more I think about Bags and Sets, the more my

Re: Ruby Fibers (was: threads?)

2010-11-07 Thread Mark J. Reed
On Fri, Oct 15, 2010 at 10:22 AM, B. Estrade estr...@gmail.com wrote: Pardon my ignorance, but are continuations the same thing as co-routines, or is it more primitive than that? Continuations are not the same thing as coroutines, although they can be used to implement coroutines - in fact,

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-07 Thread Darren Duncan
Mason Kramer wrote: snip I want to propose one major change to the Bag spec: When a Bag is used as an Iterable, you get an Iterator that has each key in proportion to the number of times it appears in the Bag. snip You present some interesting thoughts here. But I don't have enough time to

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-07 Thread Jon Lang
Mason Kramer wrote: I'd like to anticipate one objection to this - the existence of the 'hyper' operator/keyword.  The hyper operator says, I am taking responsibility for this particular code block and promising that it can execute out of order and concurrently.  Creating a Bag instead of

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-07 Thread Moritz Lenz
On 11/08/2010 01:51 AM, Darren Duncan wrote: Mason Kramer wrote: snip I want to propose one major change to the Bag spec: When a Bag is used as an Iterable, you get an Iterator that has each key in proportion to the number of times it appears in the Bag. snip You present some