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 toStack to Ordered primitive Iterable #1045

Open
donraab opened this issue Dec 23, 2020 · 5 comments
Open

Add toStack to Ordered primitive Iterable #1045

donraab opened this issue Dec 23, 2020 · 5 comments

Comments

@donraab
Copy link
Contributor

donraab commented Dec 23, 2020

There is a method toStack on OrderedIterable, but no equivalent toStack method on Ordered<Primitive>Iterable.

@DineshPurushothamacharya
Copy link
Contributor

@donraab - I'd like to work on this. Can you please assign it to me?

@donraab
Copy link
Contributor Author

donraab commented Feb 12, 2021

Hi @DineshPurushothamacharya, thanks for volunteering! I've assigned it to you.

@DineshPurushothamacharya
Copy link
Contributor

Hello @donraab,

So far I understand that I need to update orderedPrimitiveIterable.stg file like below. correct me if am wrong.

default Mutable<name>Stack toStack()
{
   return 
}

I have a question on creating the MutableStack instance from the iterable. Could you help me pointing to the right factory method to create this instance?

@donraab
Copy link
Contributor Author

donraab commented Feb 16, 2021

Hi @DineshPurushothamacharya, the static factories are not available in the interfaces for primitive collections, so you will not be able to implement this in a default method. You can throw UnsupportedOperationException in the default method, and then implement it in the specific implementations.

@DineshPurushothamacharya
Copy link
Contributor

Hello @donraab ,

I have created the below PR [1] for this issue. Could you please review it ?

[1] : #1068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants