3 ms·
Regarding other kinds of evaluation, like evaluating graphs, this is a bit the idea behind XLR (http://xlr.sf.net http://xlr.sf.net). In that case, evaluation b
by c3d 14y ago
Regarding other kinds of evaluation, like evaluating graphs, this is a bit the idea behind XLR (http://xlr.sf.net http://xlr.sf.net). In that case, evaluation by rewriting parse trees.
Example: a factorial is defined as
0! -> 1
N! -> N*(N-1)!
An if-then-else statement as:
if true then X else Y -> X
if false then X else Y -> Y
The core operator is the rewrite -> which means: rewrite the parse tree on the left into the parse tree on the right. There are of course rules about binding and stuff, and the type system is a bit of a challenge. But the idea may be intestto whoever is still hanging around this thread :-)