degenerate-code

In what languages can you dynamically rewrite functions on the fly?

I recently had the necessity of rewriting a javascript function in javascript, dynamically. The ease with which I did it, and how fun it was, astounded me. Over here I've got some HTML: <div id="excelExport1234" onclick="if(somestuff) location.href='http://server/excelExport.aspx?id=56789&amp;something=else'; else alert('not imp...

Can you show me how to rewrite functions in lisp?

Consider this javascript: function addX(n) { return 3 + n; } alert(addX(6)); //alerts 9 eval('var newFunc = ' + addX.toString().replace("3", "5") + ';'); alert(newFunc(10)); //alert 15 Please ignore the fact that it's of dubious use and methodology, dangerous, difficult to follow in a large codebase, and so on. It lets you modify t...