|
From: | Ralf Hemmecke |
Subject: | Re: [Axiom-developer] RE: Types as values, and Re: Static versus Dynamically typed(was:Philosophy... ) |
Date: | Mon, 26 Sep 2005 13:30:36 +0200 |
User-agent: | Mozilla Thunderbird 1.0 (X11/20041206) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |