Skip to content

Instantly share code, notes, and snippets.

@mhuebert
Created March 17, 2019 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhuebert/80f29769558ecf252c9dec144019f94d to your computer and use it in GitHub Desktop.
Save mhuebert/80f29769558ecf252c9dec144019f94d to your computer and use it in GitHub Desktop.
tabular formatting wish
;; `table` configured with indent-1 and "align-tabular"
(table {:size [3 3]}
'_ "| " "|[ ]" "[|]"
[:cursor/move :x 1] " |" "[| ]" "[]|"
[:cursor/move :x -1] "| " "|[ ]" "[]")
;; just for context - one might compile ^that to
;; something like the following
(fn [x y]
(case [x y]
[[:cursor/move :x 1] "| "] " |"
[[:cursor/move :x 1] "|[ ]"] "[| ]"
[[:cursor/move :x 1] "[|]"] "[]|"
[[:cursor/move :x -1] "| "] "| "
[[:cursor/move :x -1] "|[ ]"] "|[ ]"
[[:cursor/move :x -1] "[|]"] "|[]"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment