From f3bd44083da5a3579b11e37b36408c0d40dbe51d Mon Sep 17 00:00:00 2001 From: slava Date: Tue, 1 Aug 2006 01:08:25 +0000 Subject: [PATCH] Nicer sheet. implementation --- TODO.FACTOR.txt | 1 - library/tools/describe.factor | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 08c37164fc..05d2d9a256 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -6,7 +6,6 @@ - gdb triggers 'mutliple i/o ops on port' error - "localhost" 50 won't fail - factorcode httpd crashed: bad file descriptor -- one-column table doesn't need borders...? - editor: - scroll to caret - better listener multi-line expression handling diff --git a/library/tools/describe.factor b/library/tools/describe.factor index c4aaaf28d7..ec3c4bef70 100644 --- a/library/tools/describe.factor +++ b/library/tools/describe.factor @@ -77,10 +77,14 @@ M: vocab-link summary ( vocab-link -- ) DEFER: describe : sheet. ( sheet -- ) - flip - H{ { table-gap { 10 0 } } } - [ dup unparse-short swap write-object ] - tabular-output ; + flip dup empty? [ + drop + ] [ + dup first length 1 = + { 0 0 } { 10 0 } ? table-gap associate + [ dup unparse-short swap write-object ] + tabular-output + ] if ; : describe ( object -- ) dup summary print sheet sheet. ;