Emacs org-mode can evaluate source code and capture the results. For example, for the following block, we can run org-babel-execute-src-block or org-babel-execute-buffer to get the results. We can use org-edit-src-code to edit a source code block in a separate buffer. Here is a introduction tutorial to Babel in org-mode.

  (let ((xx 42))
    (print xx))