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

Methods for get an Array of values or View of a IntSet or Set #2774

Closed
diegozea opened this issue Apr 6, 2013 · 4 comments
Closed

Methods for get an Array of values or View of a IntSet or Set #2774

diegozea opened this issue Apr 6, 2013 · 4 comments

Comments

@diegozea
Copy link
Contributor

diegozea commented Apr 6, 2013

There isn't a values() method for IntSet and Set

@diegozea
Copy link
Contributor Author

diegozea commented Apr 6, 2013

For Set an easy implementation would be:

values(set::Set) = keys(set.hash)

@JeffBezanson
Copy link
Member

A "view" of the values in a set is the set itself. If you want an array of the values, use collect(s).

@diegozea
Copy link
Contributor Author

diegozea commented Apr 6, 2013

Thanks Jeff, I was looking for collect()
Isn't not documented on Set-like but is in Associative Collections
values() sound more intuitive to me, but collect() is fine.

@diegozea diegozea closed this as completed Apr 6, 2013
@JeffBezanson
Copy link
Member

After #2347 it might make sense to define values(s::Set) = s.

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