Browse Source

Small fixes

* lisp/ob-asymptote.el (org-babel-asymptote-define-type):
* lisp/ob-processing.el (org-babel-processing-define-type): Small fixes
  following lexical binding move.
Nicolas Goaziou 9 years ago
parent
commit
0611129578
2 changed files with 21 additions and 26 deletions
  1. 11 15
      lisp/ob-asymptote.el
  2. 10 11
      lisp/ob-processing.el

+ 11 - 15
lisp/ob-asymptote.el

@@ -123,21 +123,17 @@ a variable of the same value."
 
 DATA is a list.  Return type as a symbol.
 
-The type is `string' if any element in DATA is
-a string.  Otherwise, it is either `real', if some elements are
-floats, or `int'."
-  (let* ((type 'int)
-	 find-type			; for byte-compiler
-	 (find-type
-	  (function
-	   (lambda (row)
-	     (catch 'exit
-	       (mapc (lambda (el)
-		       (cond ((listp el) (funcall find-type el))
-			     ((stringp el) (throw 'exit (setq type 'string)))
-			     ((floatp el) (setq type 'real))))
-		     row))))))
-    (funcall find-type data) type))
+The type is `string' if any element in DATA is a string.
+Otherwise, it is either `real', if some elements are floats, or
+`int'."
+  (letrec ((type 'int)
+	   (find-type
+	    (lambda (row)
+	      (dolist (e row type)
+		(cond ((listp e) (setq type (funcall find-type e)))
+		      ((stringp e) (throw 'exit 'string))
+		      ((floatp e) (setq type 'real)))))))
+    (catch 'exit (funcall find-type data)) type))
 
 (provide 'ob-asymptote)
 

+ 10 - 11
lisp/ob-processing.el

@@ -179,17 +179,16 @@ a variable of the same value."
 
 DATA is a list.  Return type as a symbol.
 
-The type is `String' if any element in DATA is
-a string.  Otherwise, it is either `float', if some elements are
-floats, or `int'."
-  (let* ((type 'int)
-	 find-type			; For byte-compiler.
-	 (find-type
-	  (lambda (row)
-	    (dolist (e row type)
-	      (cond ((listp e) (setq type (funcall find-type e)))
-		    ((stringp e) (throw 'exit 'String))
-		    ((floatp e) (setq type 'float)))))))
+The type is `String' if any element in DATA is a string.
+Otherwise, it is either `float', if some elements are floats, or
+`int'."
+  (letrec ((type 'int)
+	   (find-type
+	    (lambda (row)
+	      (dolist (e row type)
+		(cond ((listp e) (setq type (funcall find-type e)))
+		      ((stringp e) (throw 'exit 'String))
+		      ((floatp e) (setq type 'float)))))))
     (catch 'exit (funcall find-type data))))
 
 (provide 'ob-processing)