[Vm-dev] I just did a terrible thing :-)

tim Rowledge tim at rowledge.org
Sat Sep 19 17:40:11 UTC 2020



> On 2020-09-19, at 8:40 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> Hi Smalltalkers,
> 
>     I just made a Smalltalk := nil type blunder.  I wrote:
> 
> 			TVariableNode setName:
> 				(node selector = #maxVal
> 						ifTrue: ['MaxSmallInteger']
> 						ifFalse: ['MinSmallInteger'])
> 
> and suddenly parse tree printing didn't work and TVariableNode was called MaxSmallInteger :-)

This is just one of the reasons I'd really like properly done private methods; if the Class>setName: method were private you wouldn't have been able to do this. And a lot of other people (ie almost certainly absolutely every person the ever wrote any Smalltalk) wouldn't make a whole raft of mistakes.

I'm not sure we could do it without breaking so much code that we  exploded our brains. Sigh.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: UDF: Use Disk for Frisbee




More information about the Vm-dev mailing list