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

Added stubs for SplDoublyLinkedList, SplQueue and SplPriorityQueue #205

Closed
wants to merge 2 commits into from
Closed

Added stubs for SplDoublyLinkedList, SplQueue and SplPriorityQueue #205

wants to merge 2 commits into from

Conversation

dktapps
Copy link
Contributor

@dktapps dktapps commented May 16, 2020

I made these for a project I'm working on, perhaps they'll be useful to someone else :)

NB: SplPriorityQueue is very nasty because the return types depend on the extract flags, which aren't available in the type system. It might be necessary to implement a dynamic return type extension for those.

ondrejmirtes and others added 2 commits May 22, 2020 18:17
I made these for a project I'm working on, perhaps they'll be useful to someone else :)
@ondrejmirtes
Copy link
Member

Merged, thank you! 6a38951

It might be necessary to implement a dynamic return type extension for those.

Yes, please do that :)

@dktapps
Copy link
Contributor Author

dktapps commented May 30, 2020

I had a think about how to do this and the problem I keep running into is that the information needed to decide what the extract flags of PriorityQueue are is not present in the type system. If an SplPriorityQueue is passed to a function parameter, the callee doesn't know from the type system what the extract flags are.
@ondrejmirtes do you have any idea how such a problem can be solved? I'm dubious whether it's worth the time tbh; I may just create wrapper classes which seal this nastiness away (or use Ds\PriorityQueue instead).

@ondrejmirtes
Copy link
Member

Can you show a piece of code that demonstrates the problem you're facing?

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