\d .tree / @[_d;`V`H`L`B;:;_ci(179;196 205;195 198;192 212)]; / line drawing characters (windows) @[_d;`V`H`L`B;:;("|";"-=";"++";"++")]; / otherwise (mac) P:20;N:3 / print N wide up to P much tree:{[p]:[-3=4:p;($,p),group[0]dir p;group[0]object p]} / file or object dir:{[p]:[@c:!p;();,/(file'c)fuse'_f'(p,"/"),/:c]} / dir -> .. -> file file:{[c]H[&N],c} / file object:{[d]:[5=t:4:d;dict d;0=t;list d;()]} / k object dict:{[d],/(var[d].',/+(+(0;!d);+(1;~!d)))fuse'object',/+(d[];d[.])} / dictionary list:{[d]{:[(*x)_in H;x _di N;x]}'dict@.+(`$"f",'$!#d;d)} / list var:{[d;k;c]:[~k;H[&N],($c),val d c;#!d c;H[N#1],$c;""]} / variable val:{[v]:[(4:v)&P&~5=4:v;_ssr[":",:[P<#w:5:v;(P#w),"..";w];"\n";";"];""]} / value fuse:{[p;c]:[#p;(,p),group[N]c;()]} / parent + child group:{[n;c]:[#c;(n#" "),/:(bar[e].&:'H=\:e:*:'c),'c;c]} / groups bar:{[e;i;j](-#e)$1!B[H[1]=*|e _dv" "],-1_@[@[(1+|/i,j)#V;i;:;*L];j;:;L 1]} / branches show:`0:1!"\n",,/"\n",'tree@ / entry point \ d.a:.+(`x`y;10 20) d.a..k:"a string" d.a..l:`a_symbol d.b.c:20 30 d.b.d:40 50 60 d.e.f.g:(2 3#!6;.[.+(`q`r;(1 2 3;`a`b`c));`r.;:;.+(`m`n`o;80 90 100)]) .tree.show d \ +---a | +---x:10 | +---y:20 +===a. | +---k:"a string" | +---l:`a_symbol +---b | +---c:20 30 | +---d:40 50 60 +---e +---f +---g +---0 | +---0:0 1 2 | +---1:3 4 5 +---1 +---q:1 2 3 +---r:`a `b `c +===r. +---m:80 +---n:90 +---o:100 key: ---x for x ===x for x. usage: tree a / a is a dictionary tree`a / a is global (on the k tree) tree"a" / a is a path in the file tree or http://www.nsl.com/k/tree.png