From lliao@ren.eecis.udel.edu Sun Nov 17 23:38:04 2002 Date: Sun, 17 Nov 2002 23:37:34 -0500 (EST) From: Li Liao Subject: Re: hw4 > > I have couple of questions about hw#4. > > for the subclass, the assignment sheet said that a class is considered a > subclass of itself. Does this mean that if I do > val CInfo (super_id1, vdecls, mdict) = lookup cid1 ctab > val CInfo (super_id2, vdecls, mdict) = lookup cid2 ctab > (if I can say this) > then, super_id1 == super_id2 ? It means that if cid1 == cid2 then subclass cid1 cid2 should return true. > > For the (Field (e, f)), I am not sure about the datatype of Field of "Expr > * Id" I think that Id seems to be the name of the field. That is correct. > Then, what is the Expr which is not null infront of Id? Expr should evaluate to an object whose ftab should contain the f. > I can assume that it could be "This." But once again I am not sure. Expr certainly can evalute to "This", but can be any object depending on the program that is being interpreted. > > For task 3, I understand that when e1, e2 are the Int, we should compare > wether they are same as in i=3, j=3 and i==j?. When e1, e2 are objects, > saying List l1 and List l2 then we have to find out wether they are same > object? Please refer to message 26 on the bboard. > How can we know e1, e2 are Int or Object? Can I think of them as Varcecl > and get the Type? Do pattern matching. I hope this is helpful. Li