Re: Ruby Fibers (was: threads?)

2010-11-07 Thread Ben Goldberg
On Oct 15, 9:57 am, markjr...@gmail.com ("Mark J. Reed") wrote: > On Fri, Oct 15, 2010 at 7:42 AM, Leon Timmermans wrote: > > Continuations and fibers are incredibly useful and should be easy to > > implement on parrot/rakudo but they aren't really concurrency. They're > > a solution to a differen

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 brain

Re: Ruby Fibers (was: threads?)

2010-11-07 Thread Mark J. Reed
On Fri, Oct 15, 2010 at 10:22 AM, B. Estrade 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, continuations can b

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

2010-11-07 Thread Darren Duncan
Mason Kramer wrote: 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. You present some interesting thoughts here. But I don't have enough time to think ab

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

2010-11-07 Thread Jon Lang
Darren Duncan wrote: > However, if the above proposal is done, I would still want an easy way to > get the value-count pairs from a bag if I wanted them. I don't see any problem there. Mason's suggestion only deals with the Bag as seen through the the lens of the Iterable role; when viewed as a h

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

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: > >> 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. > > > You present some interest