Last active
June 10, 2017 20:49
-
-
Save alex-ilin/aac4f5b40c214ec96f4fe12a8caeea5e to your computer and use it in GitHub Desktop.
Greater memory footprint due to `keys` and `map`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: first-column-width ( table model -- width ) | |
value>> dup sequence? [ | |
length 1 - 1array | |
] [ | |
make-mirror keys | |
] if [ unparse-short ] map | |
over renderer>> column-titles first suffix | |
row-column-widths supremum ; | |
: <inspector-table> ( model -- table ) | |
[ | |
[ make-slot-descriptions ] <arrow> inspector-renderer <table> | |
[ invoke-primary-operation ] >>action | |
line-color >>column-line-color | |
6 >>gap | |
15 >>min-rows | |
15 >>max-rows | |
40 >>min-cols | |
40 >>max-cols | |
monospace-font >>font | |
dup | |
] keep first-column-width 0 2array >>fixed-column-widths ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The proposed code would not work, because
column-titles first
returns the string "Key". I'd have to callcell-dim nip +
on the string to be able tomax
it with the result ofrow-column-widths supremum
. But callingcell-dim
that way is what I'm trying to avoid by using therow-column-widths
in the first place.