Sorted dict 1

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

For the container to work correctly, it is a requirement that a==b if and 
only if !(a<b) && !(b<a).  For the isless function operating on common 
types, this requirement is satisfied by the usual isequal function, which 
is why the equality test for 'Forward' and 'Reverse' are both the built-in 
isequal.

But if the user goes to the trouble of defining a custom ordering (e.g., 
ordering ASCII strings in a case-insensitive manner), then it is no longer 
reasonable to expect the requirement mentioned above to hold for isequal, 
so in this case the container defaults to defining equality to be !(a<b) 
&& !(b<a) in terms of the user-provided lt function.

-- Steve


On Mon, 15 Sep 2014, Kevin Squire wrote:

> 
> In src/balancedTree.jl:
> 
> > +    initializeTree!(t.tree)
> > +    t.depth = 1
> > +    t.rootloc = 1
> > +    t.freetreeinds = Array(Int,0)
> > +    t.freedatainds = Array(Int,0)
> > +    empty!(t.useddatacells)
> > +    push!(t.useddatacells,1)
> > +    push!(t.useddatacells,2)
> > +end
> > +
> > +## Default implementations of eq for Forward, Reverse
> > +## and default ordering
> > +
> > +eq(::ForwardOrdering, a, b) = isequal(a,b)
> > +eq(::ReverseOrdering{ForwardOrdering}, a, b) = isequal(a,b)
> > +eq(o::Ordering, a, b) = !lt(o, a, b) && !lt(o, b, a)
> 
> My understanding of why you want this is because in Orderings of complex types, two objects can
> be equivalent according to sort order, but not necessarily be equal in a hash sense.
> 
> Is this correct?
> 
> @StefanKarpinski, any thoughts on this?
> 
> —
> Reply to this email directly or view it onGitHub.[7881863__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNjQ2NzE2MiwiZGF0YSI6eyJpZCI
> 6NDE3MzQ5Mjl9fQ==--9773bcf4f31cdb0614ac07a9e64cf1e1b6519a97.gif]
> 
> 
>