Your a() function can return the result of eval().

javascript Code:
  1. function a(){ return eval("return function(){ return 7 }") }
  2. F = a()
To copy to clipboard, switch view to plain text mode 

But I would try something like this:
javascript Code:
  1. globalObj = this // global context
  2. function a() { eval("globalObj.F = function(){ return 7; }") }
  3. a()
  4. F()
To copy to clipboard, switch view to plain text mode