Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not an issue per-say, but feature improvement hack I made #6

Open
jonbarkerlondon opened this issue Jan 28, 2020 · 0 comments
Open

Comments

@jonbarkerlondon
Copy link

jonbarkerlondon commented Jan 28, 2020

...To allow for additional metadata on each item.

enum

I just declared vals = Vector{Tuple{Symbol,Integer,Any}}() - note the Any rather than String.
And added a new method

        function $(esc(:getattributes))(x::$(esc(typename)))
           for (sym, i, str) in $vals
                if i == $(basetype)(x)
                    return str
                end
            end
            return nothing
        end

Great package by the way! Been looking for this for a while but didn't know how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant