My last mail to fricas-devel since I agree with Bill that this is a sole Aldor question.

I'm using aldor interpreter and there

Warning. The aldor interpreter is not very reliable. I wouldn't use it to simply #include your TypeFinder2.as file.

%2>>  #include "TypeFinder2"
Defined TypeFinder @ (S: Type) ->  (
  with GetType: S ->  Type
     ==  add ()
)
                                            Comp: 0 msec, Interp: 0
msec
"TypeFinder2.as", line 7:         GetType (x: S): Type == S
                           .................^
[L7 C18] #1 (Warning) Function returns a domain that might not be
constant (which may cause problems if it is used in a dependent type).

%3>>  import from TypeFinder(Integer)
                                            Comp: 0 msec, Interp: 0
msec
%4>>  import from Integer
                                            Comp: 10 msec, Interp: 0
msec
%5>>  GetType 2
   () @ Type
                                            Comp: 0 msec, Interp: 0
msec

If at all then you would have to write

#include "aldor"
#inlcude "aldorinterp"
#include "TypeFinder2"

The reason is that aldorinterp.as provides "print" which is required by the interpreter, but not by default provided by the aldor library.

I expected GetType 2 to return something like
   Integer @ Type

But for that to work "Type" must be of type "OutputType". Since "Type" does not export anything, you are out of luck.

If you want, you can achieve an output of "Integer @ Type". It would be more of a hack then proper Aldor programming, since you must figure out how a domain can print its own name.

Look for the function name$Trace at
https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/aldor/src/util/ald_trace.as
It provides this functionality.

But again a warning. You cannot rely on correct behaviour of that function, since it is not specified in the Aldor User Guide!
It's rather deep knowledge of the compiler internals.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to