minor tweaks

cvs
Slava Pestov 2005-09-27 18:35:30 +00:00
parent 99fe3b4a54
commit 7c3fccfef8
3 changed files with 13 additions and 9 deletions

View File

@ -20,13 +20,18 @@ M: array sheet 1array ;
M: hashtable sheet dup hash-keys swap hash-values 2array ;
: format-column ( list -- list )
[ unparse-short ] map
[ 0 [ length max ] reduce ] keep
[ swap CHAR: \s pad-right ] map-with ;
: format-column ( list ? -- list )
>r [ unparse-short ] map
r> [
[ 0 [ length max ] reduce ] keep
[ swap CHAR: \s pad-right ] map-with
] unless ;
: format-sheet ( sheet -- list )
[ format-column ] map flip [ " " join ] map ;
#! We use an idiom to notify format-column if it is
#! formatting the last column.
dup length reverse-slice [ 0 = format-column ] 2map
flip [ " " join ] map ;
DEFER: describe

View File

@ -37,5 +37,5 @@ C: outliner ( gadget quot -- gadget )
#! The quotation generates child gadgets.
<frame> over set-delegate
[ set-outliner-quot ] keep
[ @top frame-add ] keep
[ >r 1array make-shelf r> @top frame-add ] keep
f over set-outliner-expanded? ;

View File

@ -8,7 +8,8 @@ namespaces sequences strings vectors ;
! identity. They hold a property map.
: word-prop ( word name -- value ) swap word-props hash ;
: set-word-prop ( word value name -- ) rot word-props set-hash ;
: set-word-prop ( word value name -- )
rot word-props pick [ set-hash ] [ remove-hash drop ] if ;
! Pointer to executable native code
GENERIC: word-xt
@ -121,8 +122,6 @@ M: compound definer drop \ : ;
M: word literalize <wrapper> ;
M: wrapper literalize <wrapper> ;
: gensym ( -- word )
#! Return a word that is distinct from every other word, and
#! is not contained in any vocabulary.