overwriting <= operator

"Boris Gärtner" Boris.Gaertner at gmx.net
Tue Feb 28 13:31:45 UTC 2006


"nelson -" <nelson1977 at gmail.com> wrote:
> 
> hi all,
>   can i overwrite the behaviour of <= operator for a squeak class?
Yes, of course.
Look into the instance protocol of Number to see an example.
You can add the following method to any class:

<= anObject
   self halt.

When you add this to the instance protocol of Set,
you can evaluate

  Set new <= 5

and you will the the halt in the debugger.

> It seems
> I fail in doing it...
> 

 
Greetings, Boris



More information about the Squeak-dev mailing list