|
Re: Adding methods to Integers...: msg#00094lang.smalltalk.squeak.beginners
Hi Patrick, some of the symptoms you describe have to do with a small set of classes being "hardwired" in Squeak's virtual machine. To see which they are, evaluate (printIt) Smalltalk specialObjectsArray select: [:each | each isBehavior] So when you do primitive arithmethic with your own subclass of LargePositiveInteger, the VM returns an instance of LargePositiveInteger (and not your subinstance of it). Of course the specialObjectsArray can be changed and from then on the VM (after being notified) will use your subclass but, I think this is not what you really want ;-) Putting your methods into Integer is fine as long as they do not conflict with anything else. Yes, this is the usual approach for adding new behavior to all the integers :) /Klaus On Thu, 12 Apr 2007 17:28:01 +0200, you wrote:
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Squeak Firefox plugin on Linux, Bert Freudenberg |
|---|---|
| Next by Date: | Re: Error: No content to install, Isaac Gouy |
| Previous by Thread: | Re: Adding methods to Integers..., Ralph Johnson |
| Next by Thread: | Re: Re: Adding methods to Integers..., Bert Freudenberg |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |