On Thu, Jun 10, 2021 at 3:21 AM Pierre Joye <pierre....@gmail.com> wrote:

> Good morning Larry,
>
> Thank you. Very good summary, maybe worth adding to the RFC :)
>
> On Wed, Jun 9, 2021 at 11:52 PM Larry Garfield <la...@garfieldtech.com>
> wrote:
>
> >  readonly would be a separate, independent feature/syntax.
>
> Yes, my thought is about self explanatory syntax matching common usage
> of the same syntax/keyword with other languages. In this case,
> readonly, it does not :)
>
> Absolutely not a big deal (one will google that more ;), however I do
> like some "consistency" across languages as we almost all rely on many
> and get used to syntax for very standard operations like this.
>

The usage of "readonly" as proposed follows the commonly accepted
interpretation in other languages (modulo details). Readonly properties
refer to properties that only allow initializing assignments, though what
exactly that means is language dependent (e.g. it can take the form of
"only assignments inside the constructor"). Both C# and TypeScript use
"readonly" in this manner.

I'm not sure where you got the strange idea that "readonly" can refer to
asymmetric visibility. The two syntactic approaches to asymmetric
visibility that I'm aware of are "{ get; private set; }" in C# and "public
private(set)" in Swift. Neither use the "readonly" terminology for this
purpose. Using "readonly" to describe asymmetric visibility is semantically
incorrect, as such properties are not, in fact, read-only.

Regards,
Nikita

Reply via email to