You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
I know @gosukiwi stated that we don't want to require PHP 5.5+, but it wouldn't stop people with 5.4 using Blueberry, they just couldn't use generator comprehensions.
Ideal syntax:
[2 * i for i in [1..10] where i % 2 == 0] - list comprehension
(2 * i for i in [1..10] where i % 2 == 0) - generator comprehension
The text was updated successfully, but these errors were encountered:
I love lazy collections. Generator comprehensions could easily be implemented on PHP 5.5+ using yield.
result = function($collection) {
foreach($collection as $item) {
yield $item;
}
}
Something I really like of PHP 5.4 is Traits, which would be an elegant way to implement Ruby-like modules. I'll leave this pull request open so anyone willing to implement Generator Comprehensions can submit a pull request 😄
Like list comprehensions, but produces a generator. Python has these.
I know @gosukiwi stated that we don't want to require PHP 5.5+, but it wouldn't stop people with 5.4 using Blueberry, they just couldn't use generator comprehensions.
Ideal syntax:
[2 * i for i in [1..10] where i % 2 == 0]
- list comprehension(2 * i for i in [1..10] where i % 2 == 0)
- generator comprehensionThe text was updated successfully, but these errors were encountered: