|
Re: Adding methods to Integers...: msg#00102lang.smalltalk.squeak.beginners
On Fri, 13 Apr 2007 13:39:08 +0200, Bert Freudenberg wrote: On Apr 13, 2007, at 13:27 , Klaus D. Witzel wrote: Sure, but this thread is not about what happens when the optional primitive is removed, and I was not reflecting that, either. I was rather discussing the point when the primitive does *not* fail on one of Patrick's subclasses and, what the returned species is. You could change the Integer classes to handle subclasses properly (via species etc.). So far, this has not been necessary. My point was that this (unlike SmallIntegers) is *not* hard-coded in the VM. I think it depends on operand order. When the LargeIntegers module is invoked (in my previous example when sending + myLargeInteger to SmallInteger 1) then a "hard-coded" instance of LargePositiveIntegers is returned. The attached class can be used (together with my previous example) to illustrate my point. The class does not inherit from some default large integer class and the primitive does not fail, regardless of operand order. I hope I didn't base my argument on a bug or mistake. FWIW I do not disagree with anything about your argument, except a bit with "hard-coded". - Bert -
Beginners mailing list Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx http://lists.squeakfoundation.org/mailman/listinfo/beginners
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Adding methods to Integers..., Bert Freudenberg |
|---|---|
| Next by Date: | Re: Re: Adding methods to Integers..., Bert Freudenberg |
| Previous by Thread: | Re: Re: Adding methods to Integers..., Bert Freudenberg |
| Next by Thread: | Re: Re: Adding methods to Integers..., Bert Freudenberg |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |