bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Improved "df" function


From: Christian Robert
Subject: [Bug-apl] Improved "df" function
Date: Wed, 7 Sep 2016 22:08:16 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

improved "df" function. This one won't wrap around when window size is
not large enough to display all functions and lambda. The output is
actually truncated to the window size, the goal is giving a quick look
of the workspace. As usual, make it a one workspace with one function,
both named "df" so ")copy df df" work to import it in any workspace.

Xtian.



      )sic
      )erase df
      ∇df;names;func;lambda;⎕pw;t
⎕pw←10000
names←((⊂[⎕io+1]⎕nl 3 4)~¨' ')~ ⊂"df"
lambda←({'λ'=↑⎕cr ⍵}¨names)/names
→(2> ⍴lambda)/nosrtl
lambda←{⍵[⎕av⍋⊃⍵]} lambda
nosrtl: func←names~lambda
→(2>⍴func)/nosrtf
func←{⍵[⎕av⍋⊃⍵]} func
nosrtf: func←{⍵ (22 ⎕cr ⎕cr ⍵)} ¨ func
lambda←{⍵,'←{',({⌽ {(+/^\' '=⍵)↓⍵} ⌽ ⍵} 2↓((⎕cr ⍵)[1+⎕io;])),({{⌽ {(+/^\' 
'=⍵)↓⍵} ⌽ ⍵} {(∨\t=';')/t←(⎕cr ⍵)[⎕io;]} ⍵} ⍵),'}'} ¨ lambda
⎕←,[⍳0] {((⍴,⍵)⌊(¯2+⎕fio ¯8))↑,⍵} ¨ ⊂[⎕io+1]⍕ ,[⍳0] ,func,(⊂' '),lambda,(⊂' ')
∇


reply via email to

[Prev in Thread] Current Thread [Next in Thread]