[squeak-dev] beReadOnlyObject (was: FileStreams Limit)
David T. Lewis
lewis at mail.msen.com
Sat Feb 19 15:32:18 UTC 2022
On Sat, Feb 19, 2022 at 02:27:48PM +0100, J??rg Belger wrote:
> > Am 19.02.2022 um 14:14 schrieb Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> > For immutability, please see #beReadOnlyObject.
> I cannot find the #beReadOnlyObject with MethodFinder in 5.3 or in class Object
Eliot added this last March, so it is in the trunk image now but was
not present in the 5.3 release image.
A new 6.0 release is expected some time in the next month or so, but
in the mean time you can find #beReadOnlyObject in the current trunk
image (the download link is at https://squeak.org/downloads/), or you
can update an existing 5.3 image (preferences browser, category "updates",
change the Update URL to http://source.squeak.org/trunk, then Update
Squeak from the mouse menu at upper left).
Here the the commit notices from the trunk update stream:
Time: 11 March 2020, 1:12:02.344414 pm
Add the core of read-only support, which will provide both for read-only literals and for efficient write-through cacheing to object databases such as gemstone.
This implementation differs slightly from Clément Béra's original implementatin for Pharo in that here ModificationForbidden always uses a mirror (either a Context or a Class) to attempt to modify the read-only
object in retryModification.
Time: 11 March 2020, 6:49:23.875063 pm
Read-only object support.
Have ModificationForbidden allow retrying modification without resuming (retryModificationNoResume) or resuming (retryModificatio). Ideally this would just be retryModification and resume but Pharo got there first and compatibility is a virtue.
Add BinaryModificationForbidden to support Array and the elementsExchangeIdentityWith: become machinery, and simplify the Behavior adoptInstance: mchinery. Decouople resumeValue from newValue to allow Array and the elementsExchangeIdentityWith: become machinery to answer the correct result.
Extend the execution simulation machionery to correctly simulate attempting to assign the inst vars of read-only objects.
Add Object class>>releaseNotes as a scratch pad for people to add things that should appear in the release notes.
More information about the Squeak-dev