Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > Martin Rubey <[EMAIL PROTECTED]> writes: > > [...] > > | > Every (exported) function is characterized by its modemap (be sure you > | > appreciate the differences between the two kinds of modemap). So if you > | > want to know the conditions that characterize a function, look at its > | > modemap. > | > | Well, that's only part of the story. Here are some names: > | > | > | ; minRowIndex x == mnRow > | (DEFUN |MATRIX;minRowIndex;$I;1| (|x| $) 1) > | > | ; minColIndex x == mnCol > | (DEFUN |MATRIX;minColIndex;$I;2| (|x| $) 1) > | > | ; swapRows_!(x,i1,i2) == > | (DEFUN |MATRIX;swapRows!;$2I$;3| (|x| |i1| |i2| $) > | > | Thus, the name of an (exported) function is something like > | > | CONSTRUCTORNAME;operationName;signature;index > | > | where signature is a string created by somehow abbreviating the modemap (I > | guess taking the first letter of the type of each argument, replacing > | several consecutive identical letters by nL, and > | > | index a running index. > | > | But I have no idea at what point during compilation the names of the > | operations are determined. > > Could you expand on exactly what you mean by this? Do you mean the > encoding, or do you mean the result of overload resolution?
I mean the encoding. That is, at some point when compiling bar in, say FOO(): with bar: Integer -> Integer foo: Integer -> Integer == add foo m == m**2 bar m == foo m + random 100 comp3 in compiler.boot gets arguments comp3: (%Form,%Mode,%Env) -> %Triple comp3(x,m,$e) == [...] x = (|foo| |m|) m = (|Integer|) e = environment...big and eventually calls t:= compExpression(x,m,e) compExpression: (%Form,%Mode,%Env) -> %Triple in turn returns something like (|call| (elt $ 8) |m|) [...] This result, instead of calling foo directly, instructs axiom to go to the domain vector, etc. You know all this, I guess. What I'd like to have, however, is that in certain circumstances (namely, whenever we are not in a category, and the definition of foo is independent of the parameters of the constructor), that comp3 returns a direct call to foo, i.e., |FOO;foo;2I;???| To do so, I'd need to construct this name given the arguments of comp3. But I do not know whether this is possible. It may well be that the running index (??? above) is known only after all of the domain has been compiled. It might be helpful to know how the 8 in (elt $ 8) above is determined... > | I hope it's before actually compiling them -- I'd like to be able to get > | the name in comp3, but I cannot see it anywhere... > | > | Any clues about question (1)? > > Why is the condition of the modemap insufficient? I hope that the above answers this question, too. In short, it seems that the (lisp) name of the function can not be deduced from the modemap alone. In fact, this is OK so, since otherwise, if X has Field then foo m == 1/m else foo m == 0 would have to be compiled very differently. Many thanks, Martin ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel