The MakePair
function is defined like this:
function MakePair(car, cdr: PScmObject): TScmObject;
Note that it receives two pointers of type PScmObject
. You then call it like this:
MakePair(Test1, Test2);
But Test1
and Test2
are of type TScmObject
. So the actual parameters passed are not compatible, just as the compiler says.
You need to pass pointers to these records instead:
MakePair(@Test1, @Test2);
In the longer term you are going to need to be careful about the lifetime of these records. You'll need to allocate on the heap and without garbage collection I suspect that you'll enter a world of pain trying to keep track of who owns the records. Perhaps you could consider using interface reference counting to manage lifetime.