Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126736 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id DA1BA1A00BE for ; Thu, 13 Mar 2025 15:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741879987; bh=7I6N/9hhfndN/pj0wnvkIRlLXIz7ySmJmoWh+ZQYoDY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ekkoJy9IvxjJJ4nabnRAJ2cgq3vYb1hRbNGJKHoZcIjGm0jiITJKCM6bJWSVs7Ofv VD2d/jMHdkKG5iBEg/m2aXkAyEuQJEX8kUl+ElqGowPKSl+05dLiYAsZGQ1OIYc3Z8 A/P/Po1s5bbJSKpBnC2YEAQWr68Dv35sbIx244zq5Bsrc6IwAyal/IW5xf/4eOfsVg wnhRN3+kVNEV9NsOXJaLtWTOQqTWNQFerMbjQRg2zkNbVFyVGLIrbaiSXu/vAI1ZPc xTdhFyvHRXbHntyVr8eJ+eo6bkqE5FEjDh5Iu5Zfsfvok9pFM1HWaLEnTyuK+EMfkP YSZxOB24DTMOg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6550D180394 for ; Thu, 13 Mar 2025 15:33:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-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,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Mar 2025 15:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1741880124; bh=MX5DNzvK4uv94mZC/LgkCZXEcI7Iy8qy7nybz4NoeWU=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=G9NesgkZFCBnsky5X8ENfQiz12PRopm6YewDIOu1VoqX3EBNrCxxAnqtPcV9FgK6e z1fzt4DvJMzvx/qLPrgviGIsofD80OEHZyB8+jle6O7uzFuLV8m8QNMOSEZAAtaYn9 NUR5bAd4j65dD+ryY5ctvjxEBD9BTJs9wtbWaRfCYS3YQnBbgXnZ/Z4GhcuAkvtIVp igHHI8Fxy/Dzbm+1UimgViIaRaTFtOAV1W315+DDh4TZirZ2GCKcFQnrs67Tee4/RL xcz9K1hVNnP08+wTMGRHGYcbfdwTec7Yqbil2oMFYydo7fyUaoE2yTb0N870U0FOVS ukiboRQR28TgQ== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 13 Mar 2025 16:35:24 +0100 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters In-Reply-To: <3e35cd25-c851-4ecc-8a1b-102dadb226e5@app.fastmail.com> References: <3e35cd25-c851-4ecc-8a1b-102dadb226e5@app.fastmail.com> Message-ID: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-03-11 22:45, schrieb Larry Garfield: > We should not block this kind of improvement on the hope of generics. > Worst case, we have this plus generics so you have options, how > terrible. In this case, I agree. This is an obvious addition to the type system that uses the existing infrastructure of the type system. But generally speaking, having too many options is not a good thing. It makes the language larger and more complex to learn, requires documentation effort, support by IDEs and static analyzers and similar things. > Rust-style associated types would probably work as well. I'd be fine > with that approach, too. One could argue they're more valuable as a > sort of "junior generics," but absent anyone able and willing to > implement them, again, worst-case we end up with options in the future. … so for associated types, I do not necessarily agree. They seem to be a strict subset of the functionality enabled by generics, or the functionality enabled by type aliases combined with “inner classes / inner types”. Since introducing associated types would bring entirely new syntax and semantics to the language, it is less obvious to me that they are a useful (intermediate) addition to the language. Best regards Tim Düsterhus