It might be safer to use ``new-assoc`` instead of ``clone``, which doesn't
guarantee a deep copy, and a shallow copy might not be sufficient for some
assoc types?

On Tue, Mar 8, 2016 at 9:21 AM, Jon Harper <jon.harpe...@gmail.com> wrote:

> Doug said
> "I'd rather move words to core/ before releasing if we know they belong
> there."
> I think they belong there :) So let's do this ?
>
> We can move the sequence>hashtable stuff to
> core/hashtables/hashtables.factor next to associate ?
>
> We can change assoc-combine to
>  : assoc-combine ( seq -- union )
> -    H{ } clone [ assoc-union! ] reduce ;
> +    [ f ] [ unclip clone swap [ assoc-union! ] reduce ] if-empty ;
> Then we need to change the callers who could have an empty seq, or who
> need the output to be a hashtable even though the sequence doesn't
> have hashtables
>
>
> Maybe also add hashtable-combine to be the old assoc-combine and use
> it where the input seq could be empty, or the elements were not
> hashtabes ?
>
>
> Also maybe change assoc-refine ?
> +: assoc-intersect! ( assoc1 assoc2 -- intersection )
> +    swap [ nip key? ] curry assoc-filter! ;
> +
> : assoc-refine ( seq -- assoc )
> -    [ f ] [ [ ] [ assoc-intersect ] map-reduce ] if-empty ;
> +    [ f ] [ unclip clone swap [ assoc-intersect! ] reduce ] if-empty ;
>
>
> Jon
>
>
> On Thu, Feb 18, 2016 at 11:45 PM, Jon Harper <jon.harpe...@gmail.com>
> wrote:
> > Yes I was thinking the same thing but then saw:
> > : assoc-combine ( seq -- union )
> >     H{ } clone [ assoc-union! ] reduce ;
> >
> > Le 18 févr. 2016 9:30 PM, "John Benediktsson" <mrj...@gmail.com> a
> écrit :
> >>
> >> I'm not a fan of the >hashtable methods, mostly because 'assocs' vocab
> >> doesn't really "know" about hashtables, it provides the generic
> interface
> >> (with the exception of assoc-combine).
> >>
> >> On Thu, Feb 18, 2016 at 11:48 AM, Jon Harper <jon.harpe...@gmail.com>
> >> wrote:
> >>>
> >>> As a proof of concept, this patch bootstraps fine:
> >>> http://paste.factorcode.org/paste?id=3841
> >>> there may be other places where USE: math.statistics should be
> >>> replaced with USE: assocs, I haven't checked.
> >>>
> >>> bootstrap image size is increased by 7ko : +0.1%
> >>> (even 7ko is a lot for such a small change, maybe I made a mistake ?)
> >>>
> >>> Also, maybe define all variants (for example sequence-index>assoc!
> >>> doesn't exist) ?
> >>> Jon
> >>>
> >>>
> >>> On Thu, Feb 18, 2016 at 7:47 PM, John Benediktsson <mrj...@gmail.com>
> >>> wrote:
> >>> > That's true that "core" is really a bootstrap idea, but on the other
> >>> > hand it
> >>> > would be nice to have all useful sequences words in "sequences" and
> >>> > same for
> >>> > "assocs".
> >>> >
> >>> > Something we can tackle with the new parser after the release.
> >>> >
> >>> >
> >>> > On Feb 18, 2016, at 10:42 AM, Doug Coleman <doug.cole...@gmail.com>
> >>> > wrote:
> >>> >
> >>> > Words in core/ are only supposed to be there if other vocabularies in
> >>> > core/
> >>> > use them, or if they're really useful. I'd rather move words to core/
> >>> > before
> >>> > releasing if we know they belong there.
> >>> >
> >>> > On Thu, Feb 18, 2016 at 10:20 AM, John Benediktsson <
> mrj...@gmail.com>
> >>> > wrote:
> >>> >>
> >>> >> I think that sounds like a good idea, @erg?
> >>> >>
> >>> >> There are also some good words in sequences.extras and assocs.extras
> >>> >> that
> >>> >> at some point I'd like to "promote" to core/basis.  But I'm putting
> >>> >> that off
> >>> >> until after the next release.
> >>> >>
> >>> >>
> >>> >> On Thu, Feb 18, 2016 at 10:15 AM, Jon Harper <
> jon.harpe...@gmail.com>
> >>> >> wrote:
> >>> >>>
> >>> >>> Hi list,
> >>> >>>
> >>> >>> currently we have collect-by (
> >>> >>>
> >>> >>>
> http://docs.factorcode.org/content/word-collect-by,math.statistics.html
> >>> >>> ) (and sequence>hashtable, sequence>assoc and some other mostly
> >>> >>> generic words) in math.statistics. They are a bit hard to find.
> >>> >>>
> >>> >>> Looking at the code, it looks like it would be a very small change
> to
> >>> >>> move them to core/assocs.factor
> >>> >>>
> >>> >>> This way, they would be close to to assoc>map (
> >>> >>> http://docs.factorcode.org/content/word-assoc-map,assocs.html ),
> or
> >>> >>> and we could link put them in the "Associative mapping combinators"
> >>> >>> article
> >>> >>> http://docs.factorcode.org/content/article-assocs-combinators.html
> >>> >>>
> >>> >>> What do you think ?
> >>> >>>
> >>> >>> Jon
> >>> >>>
> >>> >>>
> >>> >>>
> >>> >>>
> ------------------------------------------------------------------------------
> >>> >>> Site24x7 APM Insight: Get Deep Visibility into Application
> >>> >>> Performance
> >>> >>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >>> >>> Monitor end-to-end web transactions and take corrective actions now
> >>> >>> Troubleshoot faster and improve end-user experience. Signup Now!
> >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >>> >>> _______________________________________________
> >>> >>> Factor-talk mailing list
> >>> >>> Factor-talk@lists.sourceforge.net
> >>> >>> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> ------------------------------------------------------------------------------
> >>> >> Site24x7 APM Insight: Get Deep Visibility into Application
> Performance
> >>> >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >>> >> Monitor end-to-end web transactions and take corrective actions now
> >>> >> Troubleshoot faster and improve end-user experience. Signup Now!
> >>> >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >>> >> _______________________________________________
> >>> >> Factor-talk mailing list
> >>> >> Factor-talk@lists.sourceforge.net
> >>> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>> >>
> >>> >
> >>> >
> >>> >
> ------------------------------------------------------------------------------
> >>> > Site24x7 APM Insight: Get Deep Visibility into Application
> Performance
> >>> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >>> > Monitor end-to-end web transactions and take corrective actions now
> >>> > Troubleshoot faster and improve end-user experience. Signup Now!
> >>> > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >>> >
> >>> > _______________________________________________
> >>> > Factor-talk mailing list
> >>> > Factor-talk@lists.sourceforge.net
> >>> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>> >
> >>> >
> >>> >
> >>> >
> ------------------------------------------------------------------------------
> >>> > Site24x7 APM Insight: Get Deep Visibility into Application
> Performance
> >>> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >>> > Monitor end-to-end web transactions and take corrective actions now
> >>> > Troubleshoot faster and improve end-user experience. Signup Now!
> >>> > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >>> > _______________________________________________
> >>> > Factor-talk mailing list
> >>> > Factor-talk@lists.sourceforge.net
> >>> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>> >
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------------
> >>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> >>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >>> Monitor end-to-end web transactions and take corrective actions now
> >>> Troubleshoot faster and improve end-user experience. Signup Now!
> >>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >>> _______________________________________________
> >>> Factor-talk mailing list
> >>> Factor-talk@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >> Monitor end-to-end web transactions and take corrective actions now
> >> Troubleshoot faster and improve end-user experience. Signup Now!
> >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >> _______________________________________________
> >> Factor-talk mailing list
> >> Factor-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>
> >
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://makebettercode.com/inteldaal-eval
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to