I'm looking to implement some proof-of-concept demo for a short presentation in which the running code is aware of a hashed 'value' of the currently executing block of code. For example:
function BBB(a) {
a = 2 * a;
print me.hash; --> "xxxxxxx" (value of BBB-syntax represenation)
return a;
}
function AAA(a, b, c) {
d = BBB(a);
print me.hash; --> "yyyyyyy" (value of AAA-Syntax representation, possibly dependant on value of BBB, but not necessary)
return d;
}
I instinctively turned to LISPish languages, but had no success with Scheme yet. And I've not been in touch with Common LISP for a long time, which I suspect might be able to do it (hints appreciated). It doesn't have to be fast, or a popular platform, can be the most academic and weird platform available. It's just a demo.
Does anybody know a language/platform that can do this pretty much out of the box or with relatively little tinkering? I'd prefer some kind of parsed/treeish thing to work with, not actual source code.