Hi!
If i have 2 classes: "base" and "derived" and their implemetation in files base.hla and derived.hla.
VMT of each class declared as
readonly
VMT(<class_name>);
endreadonly;
in apropriate hla files. And when i want to call base method from overriden method in derived class as
call(base._VMT_[@offset(base.<method_name>)]);
HLA reports error:
error A2006: undefined symbol : _VMT_base___hla_
It seems that problem is _VMT_base___hla_ not defined in externdef section in derived.extpub.inc,
although it's defined in public section in base.extpub.inc
Posted on 2004-06-18 03:11:16 by Elohim Meth

Hi!
If i have 2 classes: "base" and "derived" and their implemetation in files base.hla and derived.hla.
VMT of each class declared as
readonly
VMT(<class_name>);
endreadonly;
in apropriate hla files. And when i want to call base method from overriden method in derived class as
call(base._VMT_[@offset(base.<method_name>)]);
HLA reports error:
error A2006: undefined symbol : _VMT_base___hla_
It seems that problem is _VMT_base___hla_ not defined in externdef section in derived.extpub.inc,
although it's defined in public section in base.extpub.inc


Yep, this is correct.
Maybe I'll go in real quick and make this change to HLA v1.66 (which I've just put up on
Webster, so wait a while before downloading it).
Cheers,
Randy Hyde
Posted on 2004-06-18 12:17:40 by rhyde
Okay, I've just uploaded a new version of HLA v1.66.
It incorporates a change that will solve this problem.

Now you can declare VMTs as follows:



readonly
vmt( classname); @external;


This allows you to reference a VMT symbol that is actually declared in a different source file.

Example code t:


program t;
#include( "t.hhf" )

method c.m;
begin m;
end m;

readonly
vmt( c );

begin t;

call( c._VMT_[@offset( c.m )] );
call( d._VMT_[@offset( d.n )] );

end t;

Example code t2:


unit t2;
#include( "t.hhf" )

method d.n;
begin n;
end n;

readonly
vmt( d );

end t2;

Example code t.hhf:


type
c:class
method m; @external;
endclass;

d:class inherits( c );

method n; @external;

endclass;

readonly
vmt( c ); @external;
vmt( d ); @external;



Cheers,
Randy Hyde
Posted on 2004-06-18 14:07:09 by rhyde
Hi,Randy!
Thanks a lot! :alright:
Posted on 2004-06-20 08:12:54 by Elohim Meth