Class hierarchy problem

33 views
Skip to first unread message

Gérard Bunel

unread,
Apr 26, 2013, 7:32:22 AM4/26/13
to redline-...@googlegroups.com
Hi James,

palying around redline I tried the following code:

| cls |
cls := Class.
[cls == nil]
  whileFalse:
    [
      Transcript cr; show: cls.
      cls := cls superclass.
    ]

This code fails as follow:


Class
ClassDescription
Behavior
Object
ProtoObjectException in thread "main" java.lang.NullPointerException
at st.redline.core.PrimObject.perform0(PrimObject.java:774)
at st.redline.core.PrimObject.perform0(PrimObject.java:760)
at st.redline.core.PrimObject.perform(PrimObject.java:716)

while, using Pharo, it produces the following output:

Class
ClassDescription
Behavior
Object
ProtoObject

I looked at Bootstrapper As I suspected a maybe not Nil superclass on ProtoObject. But I see that:

        PrimObjectMetaclass protoObjectClass = protoObjectMetaclass.basicCreate("ProtoObject", PrimObject.PRIM_NIL, "", "", "", "");

Which seems correct to me. So, I don't understand!!

Any advice ?

Gérard

James Ladd

unread,
Apr 26, 2013, 5:46:09 PM4/26/13
to redline-...@googlegroups.com
I suspect the problem is because Nil hasn't got a superclass set.
Ill look into it

Sent from Hyperspace.
--
You received this message because you are subscribed to the Google Groups "Redline Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redline-smallt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gérard Bunel

unread,
May 9, 2013, 6:47:25 AM5/9/13
to redline-...@googlegroups.com
Hi James,

Could you explain the differences between PrimObject.NIL and PrimObject.PRIM_NIL.
What's the purpose of PRIM_NIL?

Gérard

James Ladd

unread,
May 9, 2013, 7:34:16 PM5/9/13
to redline-...@googlegroups.com
Nil is the object and prim_nil is the primitive - during bootstrap prim_nil is used and after nil

Sent from Hyperspace.
Reply all
Reply to author
Forward
0 new messages