-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add new functions and improve documentations of Treiber stack. #158
Conversation
85cdb50
to
8f72d22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very nice! I had some minor questions, but otherwise I'm curious if you have examples use-cases for try_set
, try_compare_and_set
and set_exn
? :)
For the new functions, Originally, these functions were introduced for the hashtable from the picos library (see picos PR 317). In the context of the hashtable, these operations make a lot of sense. However, due to time constraints, I haven’t had the chance to fully explore how these could be beneficial for a stack. I might move this part of the PR to a subsequent draft PR instead. What do you think ? |
Yes I've plenty of use cases for those functions with the hashtable, but I can't think of any for the stack... so it makes sense to remove them for the time being and reconsider adding them later once a use case shows up :) |
@art-w : Thanks a lot for your reviews ! Anything else before I merge this ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Add functions to the Treiber stack, to match bounded stack in #156 :
of_list
,push_all
,pop_all
of_seq
,add_seq
,to_seq
peek_exn
,peek_opt
,pop_exn
,drop_exn
set_exn
,try_exn
try_compare_and_pop
,try_compare_and_set