You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) doerror("Observable doesn't have a name. You may call it numer: $(x.id), though")
end
Could do a PR if this is appreciated
The text was updated successfully, but these errors were encountered:
Observables.jl/src/Observables.jl
Line 20 in 40243b2
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:
Could do a PR if this is appreciated
The text was updated successfully, but these errors were encountered: