Sorted dict 1

Pull request for SortedDict and BalancedTree23 taking into account Kevin Squire's feedback from the past 12 days.
Kevin,

The delete! routine of dict.jl contains the following 
undocumented statements:

     ccall(:jl_arrayunset, Void, (Any, Uint), h.keys, index-1)
     ccall(:jl_arrayunset, Void, (Any, Uint), h.vals, index-1)

I'm guessing that the purpose of these statements is to unset any pointer 
that might be stored in h.keys[index] and h.vals[index] in order to enable 
those items to be garbage-collected sooner.  Is this correct?  If so, 
should I include similar code in SortedDict when an item is deleted from 
the structure?

Thanks,
Steve



On Sun, 5 Oct 2014, Kevin Squire wrote:

> 
> In src/sortedDict.jl:
> 
> > +IncludeLast{K, D, Ord <: Ordering}(m1::SortedDict{K, D, Ord}, first1::Int, last1::Int) = 
> > +            IncludeLast{K,D,Ord}(m1, first1, last1)
> > +
> > +typealias SDIterableTypes Union(SortedDict,ExcludeLast,IncludeLast)
> > +
> > +done(::SDIterableTypes, state::SDIterationState) = state.next == state.final
> > +
> > +function next(::SDIterableTypes, state::SDIterationState)
> > +    m = state.m
> > +    sn = state.next
> > +    if sn < 3 || !in(sn, m.bt.useddatacells)
> > +        throw(BoundsError())
> > +    end
> > +    return (m.bt.data[sn].k, m.bt.data[sn].d, SDToken(sn, m)),
> > +           SDIterationState(m, nextloc0(m.bt, sn), state.final)
> > +end
> 
> I agree that that is a lot of iterators, but generally, that is what I was thinking. Does this work
> for you?
> 
> (I'm on vacation right now, and only have very limited internet, so my responses will probably be
> shorter and less frequent than usual (if that's possible). Sorry about that!)
> 
> —
> Reply to this email directly or view it onGitHub.[7881863__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODE4MDU0NCwiZGF0YSI6eyJpZCI6N
> DE3MzQ5Mjl9fQ==--e02e447761eb7b9c8e4159d83b12e9f206eadecc.gif]
> 
> 
>