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

add functions to convert stacks and sets into arrays #4

Closed
psybers opened this issue Nov 25, 2015 · 1 comment
Closed

add functions to convert stacks and sets into arrays #4

psybers opened this issue Nov 25, 2015 · 1 comment

Comments

@psybers
Copy link
Member

psybers commented Nov 25, 2015

Similar to how keys() and values() works on maps, add a function to convert types of stack or set into arrays. E.g., if we name the new function values():

s: stack of int;
push(s, 3);
push(s, 4);
a: array of int = values(s);
# a[0] = 3, a[1] = 4

And similarly if 's' was defined as 'set of int'.

@psybers
Copy link
Member Author

psybers commented Nov 25, 2015

The implementation is simple and uses this: http://docs.oracle.com/javase/7/docs/api/java/util/AbstractCollection.html#toArray()

@psybers psybers changed the title Feature request: add functions to convert stacks and sets into arrays add functions to convert stacks and sets into arrays Dec 31, 2015
@psybers psybers closed this as completed Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant