Code: Select all
(constant '+ add)
so that + now does fp addition via add. But can you redefine built-in functions so that they call your own versions of them?
For example, if you've made a context, which has its own default function, can you make a built-in function call that function instead of its own code? You'd somehow have to get the names right...
I'm not saying this is a good idea, and I haven't got a use in mind just yet. But I was just wondering how far this 'redefine the + function to do what I say' approach could be taken.
I've got as far as defining a default function (called 'output') that basically does a 'print' operation but keeps track of what it has printed. Could that be tied to the actual 'println' name somehow? I got stuck with my experiments... :-)