Re: Analysis of property visibility, immutability, and cloning proposals
| From: | Rowan Tommins | Date: | Sat, 02 Jan 2021 18:56:09 +0000 |
| Subject: | Re: Analysis of property visibility, immutability, and cloning proposals | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112713@lists.php.net to get a copy of this message | ||
On 01/01/2021 20:31, Paul M. Jones wrote:
The complaints against the incomplete and inconsistent immutability of PSR-7 have merit.The big mistake of PSR-7, in my view, is mixing immutable objects with streams, which are inherently mutable/stateful. I wonder if there are any lessons to be learned there in terms of what kinds of immutability the language should encourage / make easy. For instance, is it better to constrain entire objects to be immutable rather than individual properties? And should there be restrictions on what you can declare as immutable, since "immutable resource" is largely nonsensical? Or is it rather a reflection that building purely immutable implementations is hard, and the language needs other facilities (monads? ownership?) to mix in those parts that don't fit? Regards, -- Rowan Tommins [IMSoP]