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
Prevent riakc_set:new/2
when the context is undefined (or patch to_op
)
#152
Comments
As an argument for allowing lists:foldl(fun(X, Set) -> riakc_set:add_element(X, Set) end,
riakc_set:new(), ListOfValues)}. Perhaps that's more of an argument for creating |
@macintux Yes, the The main difficulty is that these datatypes are only shadows of the ones on the Riak cluster, so their goal on the client-side is to encapsulate mutations, not to act like regular Erlang data structures. |
Another option might be to rename |
What's the intended use case for |
^^ |
Ok, so my reading skills aren't top notch. I'm still a bit confused as to when it would be used, though. |
Oh |
Yeah, I'm a little slow. How about |
shrug At the very least, documentation is in order. |
Documentation for data types is available via docs.basho.com and the README. Closing. |
At a glance, creating a set from scratch with
riakc_set:new(List, undefined)
seemed like a reasonable approach, butriakc_set:to_op/1
doesn't anticipate this case, thus making any set created and stored only contain any elements added after thenew/2
invocation.I'd suggest returning an error when context is undefined, or...
It's also possible to make
to_op
smart enough to handle this scenario; I haven't conducted any more than minimal tests, so it's possible that the combination ofnew/2
plus the smarterto_op
breaks a half dozen other things.https://gist.github.com/macintux/1f34d0443fdf029161c6
The text was updated successfully, but these errors were encountered: