Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98575 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33428 invoked from network); 17 Mar 2017 12:57:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2017 12:57:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=adam.baratz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=adambaratz@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.48 as permitted sender) X-PHP-List-Original-Sender: adam.baratz@gmail.com X-Host-Fingerprint: 209.85.214.48 mail-it0-f48.google.com Received: from [209.85.214.48] ([209.85.214.48:37609] helo=mail-it0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/36-38004-E3DDBC85 for ; Fri, 17 Mar 2017 07:57:36 -0500 Received: by mail-it0-f48.google.com with SMTP id g138so24389378itb.0 for ; Fri, 17 Mar 2017 05:57:34 -0700 (PDT) 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; bh=Ix3Hn660+NL1Dp9m9XFeEZCMQE8X14/MkiNral5nB5s=; b=WwYyiw668QPJSfjvJ5C9CNZth8tF5Ca6j15It7UEMuQBEg5BzMt2yasMM37iAKg+N6 Ma3PSUzlQipiByQJA6Q5ygwjoD9O4TeEvylmhop4Ahv19CAljEd3Xf0GPNYvkLZA9WKP oNfjWjCXpAt3k+4xvZ97tWUXog9nbI93y+b+84GwZStbAIPHPHFo5XMjNJ498T7dLMHp FmvkK6vwf6xnzY9sJabjjHfOlnKDCdaV3J0Y9WBZwg8AAknND/NFJp0BPxj+XXokZa6w J4fKQI+AneEp6NirfjDZpxKkgJB8yZz+l0xSDAXbpbG4Ug/uges5UJWcNZmWdDy4Bitr HkfA== X-Gm-Message-State: AFeK/H1QECoR9yl/BR60i4OJddnvKo7M22GmNE4OTIqnu/oaUMrmGyeDbXrdc84jvGZt6Q== X-Received: by 10.107.6.212 with SMTP id f81mr14269580ioi.132.1489755452278; Fri, 17 Mar 2017 05:57:32 -0700 (PDT) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id x11sm1017658ita.11.2017.03.17.05.57.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 05:57:31 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id m27so24317153iti.1 for ; Fri, 17 Mar 2017 05:57:31 -0700 (PDT) X-Received: by 10.36.134.65 with SMTP id u62mr2400100itd.34.1489755451252; Fri, 17 Mar 2017 05:57:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Mar 2017 12:57:20 +0000 X-Gmail-Original-Message-ID: Message-ID: To: Niklas Keller , PHP Internals Content-Type: multipart/alternative; boundary=94eb2c088fb87978f0054aecb896 Subject: Re: [PHP-DEV] Let range() return a generator? From: adambaratz@php.net (Adam Baratz) --94eb2c088fb87978f0054aecb896 Content-Type: text/plain; charset=UTF-8 > Yes, that's a BC break. Instead of changing it, there could be a new > function. But as it can be simply built in userland, I don't see much > reason to have it in core. Whether or not it's in core, the two-pronged approach is what Python does (range and xrange). Sometimes you want an array and not a generator. That language is really sympathetic to generator use, but it never forces you to use them. The core libraries are structured thoughtfully in that regard. Thanks, Adam --94eb2c088fb87978f0054aecb896--