Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-26 Thread Paul M . Jones
> 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.

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-26 Thread Mike Schinkel
> 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

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-26 Thread Rowan Tommins
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 (

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-26 Thread Paul M. Jones
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

Re: [PHP-DEV] Support rewinding of generators

2020-02-26 Thread Stanislav Malyshev
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

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-26 Thread Rowan Tommins
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

Re: [PHP-DEV] Support rewinding of generators

2020-02-26 Thread Levi Morrison via internals
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

Re: [PHP-DEV] Support rewinding of generators

2020-02-26 Thread Rowan Tommins
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

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-26 Thread Paul M. Jones
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

Re: [PHP-DEV] Support rewinding of generators

2020-02-26 Thread Nikita Popov
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 >

Re: [PHP-DEV] Support rewinding of generators

2020-02-26 Thread Rowan Tommins
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

Re: [PHP-DEV] Support rewinding of generators

2020-02-26 Thread Judah Wright
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++) {

[PHP-DEV] Support rewinding of generators

2020-02-26 Thread Nikita Popov
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):

[PHP-DEV] VCS Account Request: nusphere

2020-02-26 Thread Sebastian Hopfe
php-qa -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php