Hi

I am still learning but something weird happened.

In a new Workspace

Do-it   myVar := LargeInteger new 
Print-it        myVar   <error in printString: try 'Inspect it' to debug> 

When I inspect it I get 
        SubclassResponsibility: LargeInteger had the subclass responsibility to 
implement #printOn:base:

When I browse LargeInteger, then at Integer level I get a message “new” as 
follows:

new

        self == Integer ifTrue: [
                ^ self error: 'Integer is an abstract class.  Make a concrete 
subclass.'].
        ^ super new

I looked for new higher up in the hierarchy(super), but could not see it. Maybe 
I am a bit dumb still with looking up.

I tried on SmallInteger a new, but got back 
        Error: SmallIntegers can only be created by performing arithmetic.

I then checked and noticed that SmallInteger actually have new and basicNew 
implemented (override)

So the error I got on smallinteger was from the override
LargeInteger has no override, but has a “silent" error

This seems a bit weird to me

Just so you know I also tried
Do-it   myVar := LargeInteger new: 10000
Print-it        myVar class.    -> LargeInteger
Dot-it  myVar := myVar + 1

The last statement hangs the image! (Tried 3 times)

Comment:
1. I am surprised that Do-it did not give me an error on the new: (there is a 
message is the hierarchy of new:neg and maybe the neg is optional?)
2. The new: seemed to have created 10000 LargeIntegers
3. I tried the new: also with just 5, and same result, image hang. (I thought 
10,000 was maybe a very large loop for the + 1..)

Did I damage something in the image maybe? I started this one just yesterday to 
look at MOOC week1.

I do not need LargeIntegers for now but …


This is Pharo 6.0 64 Bit on Mac OSX Sierra 10.12.5 (iMac 27, 2.9GHz Intel Core 
i5, 16GB RAM)

Regards

Koos Brandt
0824542028



Reply via email to