Skip to content

Instantly share code, notes, and snippets.

@eschulte
Created August 29, 2011 17:49
Show Gist options
  • Save eschulte/1178933 to your computer and use it in GitHub Desktop.
Save eschulte/1178933 to your computer and use it in GitHub Desktop.
#+source: hetero-table
#+begin_src emacs-lisp
'((1 2 3 4)
("a" "b" "c" "d"))
#+end_src
#+source: all-to-string
#+begin_src emacs-lisp :var tbl='()
(defun all-to-string (tbl)
(if (listp tbl)
(mapcar #'all-to-string tbl)
(if (stringp tbl)
tbl
(format "%s" tbl))))
(all-to-string tbl)
#+end_src
#+begin_src emacs-lisp :var tbl=hetero-table
(mapcar (lambda (row) (mapcar (lambda (cell) (stringp cell)) row)) tbl)
#+end_src
#+results:
| nil | nil | nil | nil |
| t | t | t | t |
#+begin_src emacs-lisp :var tbl=all-to-string(hetero-table)
(mapcar (lambda (row) (mapcar (lambda (cell) (stringp cell)) row)) tbl)
#+end_src
#+results:
| t | t | t | t |
| t | t | t | t |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment