Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114819 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10647 invoked from network); 10 Jun 2021 15:39:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jun 2021 15:39:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4AB2D1804D1 for ; Thu, 10 Jun 2021 08:54:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 10 Jun 2021 08:54:26 -0700 (PDT) Received: by mail-yb1-f181.google.com with SMTP id f84so84579ybg.0 for ; Thu, 10 Jun 2021 08:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6YW0Yqjj4OzPoRWzLFbGzhWnoTT92myRdpvQAclrcdo=; b=hM6x+qQK8rTGLYUDEDAwvC0JD7wzimmICUeQle5EO341/PvWKZNIEt7AFF8CpKZE5A oWhrcdRXHkAeMIzbamsrWgv4JdC4BpMA2Rwsj47BcgRR6xGFKNGfGKfKJ9vJRH2mepxe 90Xz14wd4QQRnD/W+9gRo35u+fdSqZxpgSL1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6YW0Yqjj4OzPoRWzLFbGzhWnoTT92myRdpvQAclrcdo=; b=TDOwv6EHtWvUO1/7OsVNUhoG5hHZ8SduFMiKfqYhqPOlcQNC+WDfG1djobj1oSJtsf hQlrTW27ZJSTUVEMPBih1PWe7JpVOkthmdRgM9ZL7N9vVHsGWDgbIrfWWs6AVrPFYRTn lyAMv6N4PANlukicXxEgkF6wJEnxSyIwUIjmj6LYNjNjcxpOEOyjz0uVZrEhdC8kb2HM Cn7FuXH59WtB97+trOcm2kUU6AxF3GONcyAakvWH249HtOYU0M9p9L8igVETA29ZY5zt g6PGxFKsdpEGc6Sdq0ocj26HQlKpNmvhBcCKd/HvpFMWRuJNnOuIRhue97KYpDdhIRrC edaw== X-Gm-Message-State: AOAM533xrt+Apejgs0btWIcbVu8JfmQS+/HuEijnB1E3PQF2RgipS1FG IeMgrIwukScKjEQocSkmIPp9wNObtWHSv4rKbKlAvw== X-Google-Smtp-Source: ABdhPJx0Pf+Io2FPqNxslkjDKFBo6nvNTxp4iJkzOkBkuklfEN7Cib3vHaD7bRh/dzmMSvhhQ2KH0/l3smfYNFS2tKE= X-Received: by 2002:a25:b993:: with SMTP id r19mr8785072ybg.445.1623340465351; Thu, 10 Jun 2021 08:54:25 -0700 (PDT) MIME-Version: 1.0 References: <8b158f57-5416-1e86-07de-737e78338da7@processus.org> In-Reply-To: <8b158f57-5416-1e86-07de-737e78338da7@processus.org> Reply-To: Levi Morrison Date: Thu, 10 Jun 2021 09:54:14 -0600 Message-ID: To: Pierre Cc: tyson andre , "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: RFC: CachedIterable (rewindable, allows any key&repeating keys) From: internals@lists.php.net ("Levi Morrison via internals") On Thu, Jun 10, 2021 at 8:40 AM Pierre wrote: > > Le 10/06/2021 =C3=A0 16:16, tyson andre a =C3=A9crit : > > So I'm probably changing this to `ImmutableTraversable` as a short name= for the functionality, > > to make it clear arguments are eagerly evaluated when it is created. > > (ImmutableSequence may be expected to only contain values, and would be= confused with the ds PECL's https://www.php.net/manual/en/class.ds-sequenc= e.php) > > Hello, > > And why not simply RewindableIterator ? Isn't it the prominent feature > of it ? > > Agreed it's immutable, but a lot of traversable could be as well. > > Regards, > > -- > > Pierre > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > All iterators are "rewindable", though of course not in practice. I would avoid such names because we may eventually add an interface which works as a "tag" to say "yes, I actually do support rewinding." The property of being rewindable comes from it being cached. Maybe `CachedAggregate`? Aggregates are data structures from which an external iterator can be obtained, so it makes a bit more sense if it's eager.