Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110772 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64705 invoked from network); 29 Jun 2020 12:04:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2020 12:04:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E6AF1804C7 for ; Mon, 29 Jun 2020 03:52:40 -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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 ; Mon, 29 Jun 2020 03:52:40 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id h19so17449606ljg.13 for ; Mon, 29 Jun 2020 03:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=69749uHm6op4WF1svuJfgJcjvMbJC3jlhrRQWSRxf+8=; b=A1EjDvSyIYIuP4zPH8ns+uuxNWNy62cXxmYONrFyMyjBjTMHw/EpoIBkaJ5LNND2Zv XBGmsIP0xgw4XlbUa4DQChyajv0+9+GTFuwfTHHqmEXX5qeJDwXVpVWAlE/EyZ0eOxGF RWkY+XqImuDsKwqXm9Vmfdi3adTgMbXvwRrsm4lRukrq4Y6+eBvv7XVF79ypDKgka8pM 0hea/tONf/tlrGeMz7oeCVPwZHJUQbP+3s7I9cLFQeTcaQppQ/Oo+JyXoyF8GMk/adEW iI17jEvElJL420oqTVpvofzUx7XiXKRMnpEdRh5hXhjDfyiogsR3W4/m+cOJmD1dsGPt pHIg== 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; bh=69749uHm6op4WF1svuJfgJcjvMbJC3jlhrRQWSRxf+8=; b=ob2evNNLgbXEsCBYGugEIvwNKSlozUcQFF/y8pJ6snUd9FIiFCGcnRA8HqnEt16kht mp4De4Udm8+ghJjTiYI30MTeKmvFn6QLCNXmAUgue8pXzB9BH9SPEPN/POH8/s6G/XVa 9PWzsBaomVS9QYeG1YW3JpzY2DcpHsfglb9qIK/lxFKGTDVFFNDke03XBOXi04Gy7TtX CZEdbBCFJk/wL0P3m81vFlTOaDsJ/no+1R41j1eqVVyRSSMJdSVE6Iv+zT6+DqbU4P8E EC++u0vi+M9CrXnuYJb9bAmIxAaB3qvvzMHArQOa3BSsvisAk6KaGaNSrsvGIk3eDRnC A/GA== X-Gm-Message-State: AOAM532sc1SzNG0hoC3Zd/hSjaLMtFzj9mUnTs+R7zpVe8rsXCGIkbqj m9RDwz1KlcXM0rcOv1kOhFWmlRoIOQZXKDVwe+4= X-Google-Smtp-Source: ABdhPJy1Imu9zu8UMWW48zLTihXFIOej29kQBpyoWrAg7KN5ISO87B0akoB8qig6I2f+DEEY4zJs+ftVeQyXVdHBBtY= X-Received: by 2002:a05:651c:32c:: with SMTP id b12mr7738944ljp.326.1593427958058; Mon, 29 Jun 2020 03:52:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 29 Jun 2020 12:52:27 +0200 Message-ID: To: Deleu Cc: Max Semenik , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000006a525b05a936db6c" Subject: Re: [PHP-DEV] [RFC] Property write visibility From: andre.romcke@gmail.com (=?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?=) --0000000000006a525b05a936db6c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable man. 29. jun. 2020 kl. 12:06 skrev Deleu : > Are there any other languages that have a similar syntax? Has any other language syntax been considered The only one I could find that matches is Swift: public private(set) var numberOfEdits =3D 0 https://docs.swift.org/swift-book/LanguageGuide/AccessControl.html#ID18 Beyond that there are some notable related examples: C# public readonly Color Black =3D new Color(0, 0, 0); The semantics of readonly is closer to what we refer to as immutable here: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-= specification/classes#readonly-fields If you want other semantics in C# you'll need to resort to Accessors: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-= specification/classes#accessors Rust: // This field can be read (but not written) by super. #[readonly] pub(super) readable: i32, Essentially a feature using "attributes": https://docs.rs/readonly/0.1.6/readonly/ -- Best Andr=C3=A9 R=C3=B8mcke --0000000000006a525b05a936db6c--