I actually lifted delegate.jl directly from the DataStructures.jl package.
There it is its own file, I'm guessing because it is the common code used
by many different data structures, each of which is in its own file.
On Friday, February 27, 2015 at 4:37:00 AM UTC-8, Stuart Brorson wrote:
>
> Hi --
>
> Not a criticism, but rather a question. You put your Julia functions
> into IndexedArrays.jl, but put one macro into delegate.jl. Why?
> Is this a stylistic thing (i.e. logically separate macro definitions
> from functions)? Do other julia developers do this too? I haven't
> seen it before.... (but I'm no expert).
>
> Thanks,
>
> Stuart
>
>
> On Thu, 26 Feb 2015, Jim Garrison wrote:
>
> > I made an `IndexedArrays` package with an `IndexedArray` data structure.
> This
> > acts like a `Vector` of unique elements, but also maintains the reverse
> > mapping in a dictionary that is updated in sync with the vector,
> allowing for
> > quick lookup of the index of any element. A simple example is probably
> more
> > useful:
> >
> > julia> using IndexedArrays
> >
> > julia> ia = IndexedArray(["cat", "dog", "mouse"])
> > 3-element IndexedArray{ASCIIString}:
> > "cat"
> > "dog"
> > "mouse"
> >
> > julia> ia[1]
> > "cat"
> >
> > julia> findfirst(ia, "dog") # executes quickly via a
> dictionary
> > lookup, not sequential search
> > 2
> >
> > More details at https://github.com/garrison/IndexedArrays.jl
> >
> > In particular, I am looking for
> >
> > - A link if something similar already exists
> > - Obligatory bikeshedding on the chosen package name
> > - Any thoughts/comments/suggestions!
> >
> > Jim
> >
>