On 25 Mar 2008 11:05:34 +0100, Martin Rubey <[EMAIL PROTECTED]> wrote:

>  I was looking a little closer at the lisp code generated by the SPAD 
> compiler.
>  There are still a few things I do not understand:
>
>  a) how is some function like |IIARRAY2;maxColIndex;$I;7| actually called?  
> More
>    precisely, where does it get it's second argument (the domain vector) from?

The compiler generates the code.

>
>  b) isn't the domain vector constant for domains and packages?  I guess it 
> won't
>    be constant for default domains, right?  I believe it should be that way,
>    because there is no way that a function definition in a domain or package
>    can be overridden, contrary to default definitions in categories.

As long as you don't modify/recompile your code, the domain
vector is *conceptually* constant.  However, domains are
instantiated lazily -- which means that, they keep being modified
as long as necessary until they are completely defined.

Interestingly, as recent workshop, Stephen Watt and I were
discussing language constructs that allow to:
  (1) construct an object over a period of time
  (2) then state that the object is complete and does not
       change anymore
and have optimizations derived from that.

>
>  c) how does SPADCALL work?  I tried:
>
>     (1) -> )lisp (macroexpand '(SPADCALL |m| (QREFELT $ 28)))
>
>     Value = (LET ((#:G1406 (QREFELT $ 28)))
>               (THE (VALUES T) (FUNCALL (CAR #:G1406) |m| (CDR #:G1406))))
>

That is all, folks :-)

You place all the arguments, and the function to call last.


>
>    and I know that (QREFELT $ 28) produces element number 28 from the domain
>    vector, but I was (so far) unable to find out what it looks like precisely.

The function you're calling (or its surrogate -- e.g. goGet -- if
it hasn't been filled in yet).  You have to look at the infovec
of the instantiating constructor to see what it *conceptually* refers to.

>
>    At the end of IIARRAY2.NRLIB/code.lsp I find a MAKEPROP statement which
>    seems to take three arguments, the third one being a list with a couple of
>    elements, whose car is a vector that has as element 28
>    |IIARRAY2;ncols;$Nni;9|.  So, that has clearly something to do with the
>    domain vector, but it's only half the story...

That is the infovec of the IIARRAY2 constructror.  It contains
all information that is needed to instantiate IIARRAY2.  All the
goy details are in src/interp/nrun*.boot.

Welcome to the world of Axiom runtime system :-)

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to