Re: [RFC] [DISCUSSION] Immutable/final/readonly properties
| From: | Larry Garfield | Date: | Mon, 16 Mar 2020 20:39:18 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Immutable/final/readonly properties | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109081@lists.php.net to get a copy of this message | ||
On Mon, Mar 16, 2020, at 11:25 AM, Nicolas Grekas wrote:
> > > I repeat what I wrote before but all those problems would disappear if we
> > > were to bind the proposal to visibility:
> > > https://externals.io/message/108675#108753
> > >
> > > We could even consider splitting "read" and "write" in two
> > > separate
> > > keywords, each bound to visibility, isn't it?
> >
> > How would 2 separate keywords work, syntactically/visually? I can see how
> > it would solve a larger cluster of use cases, but I'm not sure what the
> > code would look like. :-)
> >
>
> Hum dunno, I throw the idea to fish for interest and now I can not figure
> out an answer to your question... :P
> Back to my previous suggestion on my side, which provides the core of the
> benefits we strive for IMHO...
>
> Nicolas
My best off-the-cuff thought would be compound name keywords.
readpublic writeprotected string $foo
Or something like that. Which... looks kind of ugly since I don't think we can do kebab case
keywords. :-)
--Larry Garfield