[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Apr 21 17:38:01 2003 
Subject:Re: Vector arguments to external procedures 
From:Jonathan L Cunningham 
Volume-ID:1030421.03 

On Mon, 21 Apr 2003 16:20:53 +0000 (UTC), davidy@cogs.susx.ac.uk
wrote:

>Can anyone offer any suggestions as to how to persuade the external
>interface to pass the address of an arbitrary element of a vector to an
>external procedure?
>

(snip)

>I realise that I can always provide an intermediate external routine
>that takes an address and an offset and adds them before calling the
>real routine. However, that's a pain as it has to be done for every
>external routine I want to call, and it would be much handier to have
>something that did it in Pop-11.

Surely only one intermediate? (Or one for each type of external
pointer).

The new routine doesn't call the real routine: it merely returns
the address for you to pass to the real routine?

I.e. instead of

    vars x = initintvec(100);
    exacc foo(x[30], 10);

which doesn't work, you do

    vars x = initintvec(100);
    exacc foo(addr(x, 30), 10);

where you have to define the addr function (once) but can use it
wherever you want to do this.

Am I missing something?

Jonathan

-- 
(Replace netspam by jlc when appropriate)