> On Feb 26, 2020, at 14:12, Rowan Tommins wrote:
>
> On 26/02/2020 19:57, Paul M. Jones wrote:
>
>> Do you mean something like this in the ServerRequest constructor?
>>
>> ...
>
> That's the easy part, yes; the harder part is this:
>
> ...
Yes, that would definitely be the harder part.
> On Feb 26, 2020, at 1:55 PM, Rowan Tommins wrote:
>
> On Wed, 26 Feb 2020 at 16:42, Paul M. Jones wrote:
>
>> Your presumption is correct! And your point on trying for better names is
>> well-taken -- though I think these are "expected" names, based on my
>> research into existing implementat
On 26/02/2020 19:57, Paul M. Jones wrote:
I'm sorry, I'm still having trouble seeing what you're getting at. Do you mean
something like this in the ServerRequest constructor?
public function __construct(array $globals, ?string $content = null)
{
if (
($globals['_
Hi Rowan,
> On Feb 26, 2020, at 12:55, Rowan Tommins wrote:
>
> That's a reasonable justification. Just to check, are there other
> implementations that have both of these names side by side, or do most
> implementations have one or the other, but using this naming?
My recollection is that they
Hi!
> There is a relatively simple (at least conceptually) way to make generators
> rewindable: Remember the original arguments of the function, and basically
> "re-invoke" it on rewind().
That is provided that:
1. The original arguments of the function can be "remembered" - those
can be complex
On Wed, 26 Feb 2020 at 16:42, Paul M. Jones wrote:
> Your presumption is correct! And your point on trying for better names is
> well-taken -- though I think these are "expected" names, based on my
> research into existing implementations. The most-common names are ...
>
> - the word "files" for
On Wed, Feb 26, 2020 at 4:47 AM Nikita Popov wrote:
>
> Hi internals,
>
> Generators currently do not support rewinding -- or rather, only support it
> if the generator is at/before the first yield, in which case rewinding is a
> no-op.
>
> Generators make it real breeze to implement primitives li
On Wed, 26 Feb 2020 at 15:23, Nikita Popov wrote:
> Point of order: foreach() always rewinds the array / Iterator it gets. The
> code does work correctly under the proposed scheme.
>
Ah, I'd missed that, sorry; that makes the entire first half of my e-mail
irrelevant. :)
The proposed behaviou
Hi Rowan,
> On Feb 24, 2020, at 15:47, Rowan Tommins wrote:
>
> Hi Paul,
>
> I left this thread to settle a bit, because I felt we were going round in
> circles a bit. I think there's some fundamental differences in outlook that
> no amount of discussion is going to resolve, so I've trimmed t
On Wed, Feb 26, 2020 at 4:03 PM Rowan Tommins
wrote:
> Hi Nikita,
>
> On 26 February 2020 11:47:14 GMT+00:00, Nikita Popov
> wrote:
> >There is a relatively simple (at least conceptually) way to make
> generators
> >rewindable: Remember the original arguments of the function, and basically
> >"r
Hi Nikita,
On 26 February 2020 11:47:14 GMT+00:00, Nikita Popov
wrote:
>There is a relatively simple (at least conceptually) way to make generators
>rewindable: Remember the original arguments of the function, and basically
>"re-invoke" it on rewind().
This is an interesting idea.
There is a go
Perhaps an easy userland implementation could be type-hinting a new
generator type, to indicate that the generator should be rewindable by
simply re-calling the function?
// Safe to rewind
function fooRange(int $from, int $to): RewindableGenerator {
for ($i = $from; $i <= $to; $i++) {
yield
Hi internals,
Generators currently do not support rewinding -- or rather, only support it
if the generator is at/before the first yield, in which case rewinding is a
no-op.
Generators make it real breeze to implement primitives like
function map(callable $function, iterable $iterable): \Iterator
php-qa
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
14 matches
Mail list logo