[squeak-dev] Small question about ReadOnlyVariableBinding

Bert Freudenberg bert at freudenbergs.de
Tue Nov 22 21:20:23 UTC 2011


On 22.11.2011, at 21:52, Ricardo Moran wrote:

> Hi guys,
> 
> I have just a small question: how dangerous would it be if I change a system dictionary association (such as #SerialPort) to be a read-write binding?
> 
> I want to be able to provide a different abstraction for SerialPort than the one squeak provides, but I don't want to change all the code that uses it. So I though a quick and dirty way to do it would be to replace it in the SystemDictionary, like this:
> 
> Smalltalk at: #SqueakSerialPort put: SerialPort.
> (Smalltalk associationOrUndeclaredAt: #SerialPort) beReadWriteBinding.
> Smalltalk at: #SerialPort put: MySerialPort
> 
> Apart from being an ugly hack, do you think that could be dangerous in some way?

It's a hack, sure, but what could possibly go wrong? SerialPort isn't used for anything system-critical.

- Bert -





More information about the Squeak-dev mailing list