Not yet parameterised or extracted for separate use, but:

  raco pkg install tabular


https://github.com/tonyg/racket-tabular/blob/29e91c9475407da4c5bee03abc2e6043693b3ff6/tabular/main.rkt#L681-L765

Example output:

Welcome to Racket v6.10.1.1.
> (require (submod tabular test))
> (require tabular)




                                                            > emp
 last-name  |department-id
--------------------------
"Rafferty"  |31
"Jones"     |33
"Heisenberg"|33
"Robinson"  |34
"Smith"     |34
"Williams"  |#f

> dept
department-id|department-name
-----------------------------
31           |"Sales"
33           |"Engineering"
34           |"Clerical"
35           |"Marketing"

> (table-natural-join emp dept)
 last-name  |department-id|department-name
------------------------------------------
"Rafferty"  |31           |"Sales"
"Jones"     |33           |"Engineering"
"Heisenberg"|33           |"Engineering"
"Robinson"  |34           |"Clerical"
"Smith"     |34           |"Clerical"

> (->table #:columns '(X Y Z) '(("a" "bcd" "ef") ("gh" "hhu.thnt" "t")))
 X  |    Y     | Z
--------------------
"a" |"bcd"     |"ef"
"gh"|"hhu.thnt"|"t"




On 09/21/2017 10:03 PM, 'John Clements' via users-redirect wrote:
> Before I go re-inventing the wheel, I want to ask you folks: has anyone 
> written a library that prints out tabular data in a textual format?
> 
> E.G: given 
> 
> ‘((“a” “bcd” “ef”) (“gh” “hhu.thnt” “t”)
> 
> returns
> 
> "
> ----------------------
> | a  | bcd      | ef |
> | gh | hhu.thnt | t  |
> ———————————
> “
> 
> (sorry about the horrible damage that Apple Mail inflicts upon this message.)
> 
> … in the style of postgresql and similar display engines?
> 
> It’s easy to write one of these, but if someone else has done it, it will 
> probably have nice bells and whistles that mine won’t.
> 
> John
> 
> 
> 
> 
> 
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to