The following code works the same as you asked:
function add(a)
{
var c=a,b=function(d){c+=d;return arguments.callee;};
b.toString=function(){return c;}return b;
}
Note that some operations will determine the result specified as a function, but any functions that require a string or integer will see the correct value.