Bill Page wrote:
>
> Waldek,
>
> I still do not understand Ralf's answer.
>
> Can you given an example of running code in which "compiled code can
> use types which are constructed using type constructors which were
> written _after_ compilation"? For example: A program which
> constructs some new type at run-time and then uses if for some
> computation?
>
Looking at this statement again I noticed that it may be
misleading. I mean: "compiled code can use types which are
constructed using type constructors which were written _after_
compilation of code using the type". Of course, code which
actually constructed the types must know type constructors,
so can not be written before type constructors which were
written. With that clarification you can find a lot of
trival examples of this sort in current algebra. Namely,
'Fraction' domain uses type argument which has to be
an IntegralDomain. Write a new type constructor which produces
IntegralDomain-s, pass some type constructed using it to Fraction
and you got an example.
You may protest that this is trivial example: my point is
that you can use _arbitrary_ computations to compute
arguments to Fraction, all that matter is that we
have an IntegralDomain (that is argument is of correct
category). You can use some nonsense functions like:
f(i : Integer) : IntegralDomain ==
i = 0 => Integer
Polynomial(Integer)
and then write:
T := Fraction(f(i))
Sensible examples are harder to find...
--
Waldek Hebisch
[email protected]
--
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.