Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106308 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69053 invoked from network); 28 Jul 2019 12:50:42 -0000 Received: from unknown (HELO mail-wr1-f54.google.com) (209.85.221.54) by pb1.pair.com with SMTP; 28 Jul 2019 12:50:42 -0000 Received: by mail-wr1-f54.google.com with SMTP id 31so58731271wrm.1 for ; Sun, 28 Jul 2019 03:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=nNmlBco09P30Q2+jdG69LSD7oVjs5c6gacq4FaO6UiU=; b=rxHUtvStGDrMDf2t74YCB6RmzxnYmwUdfOvJkrxeAWfwLU1IavBcEUI/2S0C3Umphl YYaTOEZY2kGJq0r1agSltspa3GKmaaOBeLs0VZPBWdnzbObVS4bZDwMiaqJ25w0sl9LK +ituTl2sogVjilpLwmyMLWG/VhR3zUP0AlB4SsgxwWjQHuVUnbcW1FcuOTSznVGeMOd5 lRn+XjIE8QgQEaXoaJTe4Z9s/kk/wcGJFz8Wj07WLYHEMXdboxCAv9bpua7AYC9CtgzA 0AmJ+EcY7BmjvLOLKED3ayG/VfxdbKPgHVKakLgguaIR5zV/v5poapRzaeWiqJO1JAQ7 /lMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=nNmlBco09P30Q2+jdG69LSD7oVjs5c6gacq4FaO6UiU=; b=MPZz5RWLafAWh3ZmY26EAEfpPvSNWk+KhyDO9vHW7q/ANjiz1U5k2VN4fzPzXzMbs9 vllTTE7uACcfLikOvs9ZyW31tvJy74CiueJaZWJDIVLZTko9zBZPBrlALpRx5QPvm2Cf zxZPlRMF7j0/NyJb5w0eW9xyfgBtzzlZgSt7+lo9jUoIcZitCcyIRVCcQv2FoTdIQKDM NB18CUPStcwoY2HIbvc7wPiJ/qYfYnP//Ip8Vdyzkxti1MCQlVOT10ItboKmdHwUC7Kr baaWN9TIx5UJF9A+ROZCG/o1ucCcipN00yTofxRPmwGiKSJP/ZTyqzysAdV87girwvmq gdjA== X-Gm-Message-State: APjAAAW/0Z42JWJCQKnjLn9B1AcjD21hCp/ktInmrqMpz4zov1YapwBs /1NqmLwEJnMKk0zbLptikVGwhYpX X-Google-Smtp-Source: APXvYqywJLUNdADdGRR/gg6LWb16PLiv5LNESVEV6kyJCnkQtrurrmSfgdtWPMLZWyQYq1uGTIlBUw== X-Received: by 2002:adf:deca:: with SMTP id i10mr12727488wrn.313.1564308903993; Sun, 28 Jul 2019 03:15:03 -0700 (PDT) Received: from [10.165.48.45] (92.40.249.26.threembb.co.uk. [92.40.249.26]) by smtp.gmail.com with ESMTPSA id p14sm47333816wrx.17.2019.07.28.03.15.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jul 2019 03:15:03 -0700 (PDT) Date: Sun, 28 Jul 2019 11:14:57 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----IVW25JT8L5RNGSW1AUSJXDXH197A9O" Content-Transfer-Encoding: 7bit To: PHP internals Message-ID: <9ADC8994-9D3C-4810-A2DB-6FB81D513098@gmail.com> Subject: Re: [PHP-DEV] Re: [RFC] Namespace-scoped declares, again From: rowan.collins@gmail.com (Rowan Collins) ------IVW25JT8L5RNGSW1AUSJXDXH197A9O Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 25 July 2019 14:34:07 BST, Nikita Popov wrote= : >Based on the received feedback, I plan to change this proposal from >being >"namespace-scoped" to being "directory-scoped" instead=2E This should >both >resolve some of the concerns and make the proposal more flexible: Not >all >code sharing the same namespace is part of the same package (multiple >packages may have classes in the same namespace) I think the word "package" here is significant, because all the other vari= ants of this proposal come down to "how can we best emulate package/module = support": - the original namespace form assumes that some level of the namespace hie= rarchy represents a package - the proposal to use a directory assumes that some structure on disk repr= esents a package - Mark's alternative using an explicit include allows every file to say it= 's part of some package I think it would be better to skip these workarounds, and define a package= directly=2E The differences I see between package and namespace are: 1) Packages should be non-hierarchical=2E Perhaps most simply a package na= me could have exactly two parts, like in composer, so it's clear that there= is no implied relationship between two packages=2E 2) A package should be explicitly declared before first use, probably in a= separate file=2E This definition would have scoped declares, and could als= o have autoload and preload definitions=2E Or perhaps a package would alway= s be eagerly loaded, allowing us to do more cross-file analysis at compile-= time=2E Obviously, there's a lot to figure out here=2E Do we define where the pack= age definition lives on disk, or require the user to configure it in some w= ay? Does a package name form the prefix for namespaces within that package,= or can a package contain definitions for any namespace? However, I think w= e should make these design decisions, rather than letting an easy implement= ation lead us somewhere we'll regret later=2E I do also share the concern that a proliferation of package options would = make the language harder to understand=2E Part of the motivation for removi= ng short open tags seems to be to make the language more consistent=2E The = ability for a package to configure the compiler as its author intended is c= ertainly better than having to test every combination, but we need to think= very carefully about what options we add=2E Regards, --=20 Rowan Collins [IMSoP] ------IVW25JT8L5RNGSW1AUSJXDXH197A9O--