On Thu, Jan 19, 2012 at 2:48 PM, Ralf Hemmecke wrote:
>
>> So just to be clear: Are you suggesting that Rep is not an essential
>> part of the SPAD language?
>
> Right.
Can you give an example of a domain in the Axiom library that does not use Rep?
>
> Do you also remember that Stephen Watt was thinking about %?
> I think it had to do with defining one domain inside another. Something like
>
> add {
> A==>%
> B==>%
> Rep == String
> D: with {foo: A -> B} == add {Rep == Integer;
> foo(x:A):B==per(2 * rep x)
> }
> foo(x: %): % ==
>
> If A=B=% then it's probably always referring to D. Is there any way that
> inside D I can refer to the % of the outer (anonymous) add domain?
>
I haven't tried this but I would write:
add {
A==%
B==%
Rep == String
D: with {foo: A -> B} == add {Rep == Integer;
foo(x:A):B==per(2 * rep x)
}
foo(x: %): % ==
That is == rather than a macro ==> definition. Macros are merely
textual substitutions so what you wrote is equivalent (after
substitution) to just writing % inside D. But == is actually
evaluated in Aldor as a constant and (hopefully) instantiated as a
domain value outside of D.
What do you think?
BTW recently thinking about the "Monad as functor" problem and
possibly how to refer to make a self-reference to the functor as
opposed to the domain constructor, I was tracing some interesting code
inside both OpenAxiom and FriCAS concerning the use of % in
F():C(%) ==
when C itself is like this:
C(R:Type):Category == with
f:(R,%) -> %
In this case it seems the internally this becomes something like
C(R:Type):Category == with
f:(R,%%) -> %%
when it is used in F. There is even a case where we may see %%% as an
intermediate form.
What I really want is a way to refer to the functor without
parameters. But Gaby has almost convinced me that this amounts to
solving a much harder problem than the one solved by %.
Regards,
Bill Page.
--
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.