Types and functions are first class entities allowing them to be
constructed and manipulated within Aldor programs just like any
other value.
Interesting. If that were so easy, it would be possible to ask a type
for the functions it implements.
Aldor allows something like
#include "aldor"
#include "aldorio"
Dom: with {
foo: % -> Boolean;
} == add {
foo(x: %): Boolean == true;
}
import from Dom;
if Dom has with {foo: % -> Boolean} then {
stdout << "foo is there" << newline;
} else {
stdout << "foo is missing" << newline;
}
However, I cannot, for example, write a function that returns a list of
names of functions implemented in Dom. (That is the current knowledge I
have.) And, of course, I see no way of morphing the result of "foo" to
"false" without writing a new function. I am not aware of
a language construct that invokes the compiler during the runtime of a
program. (The compiler might not even present on the target machine.)
Ralf
_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer