Re: Mapping generations

2008-06-27 Thread Martin Stjernholm, Roxen IS @ Pike developers forum
> The cache is needed for keeping indices() and values() stable. I figured indices(a | b) and values(a | b) would be stable too providing neither a nor b are otherwise accessed in between.

Re: Mapping generations

2008-06-27 Thread Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
>Martin Stjernholm, Roxen IS @ Pike developers forum wrote: >>Otoh, the generation counter is only necessary for a cache inside >>ShadowedMapping. I think it'd work pretty well without that cache too, >>so imo it's not worth the overhead in all mappings. Is there something >>else to motivate havi

Re: Mapping generations

2008-06-26 Thread Stephen R. van den Berg
Martin Stjernholm, Roxen IS @ Pike developers forum wrote: >Otoh, the generation counter is only necessary for a cache inside >ShadowedMapping. I think it'd work pretty well without that cache too, >so imo it's not worth the overhead in all mappings. Is there something >else to motivate having bu

Re: Mapping generations

2008-06-26 Thread Martin Stjernholm, Roxen IS @ Pike developers forum
The generation counter wrapper would have to be around the mapping being shadowed. So ShadowedMapping wouldn't be able to take an ordinary mapping for shadowing if the generation stuff isn't built into it. Otoh, the generation counter is only necessary for a cache inside ShadowedMapping. I think i

Re: Mapping generations

2008-06-26 Thread Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
Is the problem we are solving a faster overloading than if this generation stuff was handled internally in the object?

Re: Mapping generations

2008-06-26 Thread Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
Take a look at Mapping.ShadowedMapping in Pike 7.7.

Re: Mapping generations

2008-06-26 Thread Mirar @ Pike developers forum
Any example where this is used/useful? (I'm not doubting it's usefulness, I'm just curious.)

Re: Mapping generations

2008-06-26 Thread Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
>On Wed, 25 Jun 2008 13:05:02 -, Martin Stjernholm, Roxen IS @ Pike >developers forum <[EMAIL PROTECTED]> wrote: > >> This is in most cases possible to implement with a wrapper object >> instead. > >Is there a concrete reason (problem case) to have it in the language? You >are saying "mos

Mapping generations

2008-06-25 Thread Peter Bortas @ Pike developers forum
I think grubba have talked about it before, but I didn't expect it to show up at this point. Is there something we need this for grubba, or can we postpone it until after the release?

Re: Mapping generations

2008-06-25 Thread Martin Bähr
On Wed, Jun 25, 2008 at 12:55:02PM +, Martin Stjernholm, Roxen IS @ Pike developers forum wrote: > o The new builtin function m_generation isn't critical enough to >deserve a place on the global level imho. i think we should reduce the global level as much as possible, people get confu

Mapping generations

2008-06-25 Thread Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
I agree that it was a surprising addition at this time.

Re: Mapping generations

2008-06-25 Thread Bernd Schoeller
On Wed, 25 Jun 2008 13:05:02 -, Martin Stjernholm, Roxen IS @ Pike developers forum <[EMAIL PROTECTED]> wrote: This is in most cases possible to implement with a wrapper object instead. Is there a concrete reason (problem case) to have it in the language? You are saying "most" - what

Mapping generations

2008-06-25 Thread Martin Stjernholm, Roxen IS @ Pike developers forum
To detect whether a mapping has changed: int n = m_generation (the_mapping); ... if (m_generation (the_mapping) != n) { n = m_generation (the_mapping); do_stuff (the_mapping); } else werror ("we're still fine\n"); This is in most cases possible to implement with a wrapper

Mapping generations

2008-06-25 Thread Mirar @ Pike developers forum
What is the purpose?

Mapping generations

2008-06-25 Thread Martin Stjernholm, Roxen IS @ Pike developers forum
Mappings got generation counters yesterday. Although the overhead is fairly small (poking a flag on every change, and added storage in each mapping_data for a 32 bit counter), so is the utility; it at least deserves some discussion whether it should be there or not. Aside from that, I got a couple