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

Use Int for ID instead of string #18

Closed
SimonDanisch opened this issue Aug 9, 2018 · 2 comments
Closed

Use Int for ID instead of string #18

SimonDanisch opened this issue Aug 9, 2018 · 2 comments

Comments

@SimonDanisch
Copy link
Member


Should give quite a speed up compared to a string field - also it will be much clearer that it's an ID.
I also don't like to mix names and ids like this. It should either be a name or a unique id in my book ;)
We could have something like this, to have the best of both worlds:

const name_dict = Dict{Int, String}()
Observable(x, name = nothing) = (...; name != nothing && name_dict[id] = name)
name(x::Observable) = get(name_dict, x.id) do 
    error("Observable doesn't have a name. You may call it numer: $(x.id), though")
end

Could do a PR if this is appreciated

@SimonDanisch
Copy link
Member Author

Should I go ahead and implement this?

@twavv
Copy link
Member

twavv commented Apr 17, 2020

I believe that you did this in #40. :^)

@twavv twavv closed this as completed Apr 17, 2020
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

2 participants