From dd500005ef6ca6d99863ac8fed23d0699a4172a6 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Thu, 15 Apr 2010 23:00:14 -0600 Subject: [PATCH] org-babel-expand-body:haskell --- contrib/babel/lisp/langs/org-babel-haskell.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/contrib/babel/lisp/langs/org-babel-haskell.el b/contrib/babel/lisp/langs/org-babel-haskell.el index d593bb1f4..9b6785745 100644 --- a/contrib/babel/lisp/langs/org-babel-haskell.el +++ b/contrib/babel/lisp/langs/org-babel-haskell.el @@ -54,6 +54,13 @@ (defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"") +(defun org-babel-expand-body:haskell (body params &optional processed-params) + (let (vars (second (or processed-params (org-babel-process-params params)))) + (concat + (mapconcat + (lambda (pair) (format "let %s = %s;" (car pair) (cdr pair))) + vars "\n") "\n" body "\n"))) + (defun org-babel-execute:haskell (body params) "Execute a block of Haskell code with org-babel." (message "executing haskell source code block") @@ -61,10 +68,7 @@ (session (first processed-params)) (vars (second processed-params)) (result-type (fourth processed-params)) - (full-body (concat - (mapconcat - (lambda (pair) (format "let %s = %s;" (car pair) (cdr pair))) - vars "\n") "\n" body "\n")) + (full-body (org-babel-expand-body:haskell body params processed-params)) (session (org-babel-prep-session:haskell session params)) (raw (org-babel-comint-with-output session org-babel-haskell-eoe t (insert (org-babel-trim full-body))