[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] Workspace name listing utility
From: |
Frederick H. Pitts |
Subject: |
Re: [Bug-apl] Workspace name listing utility |
Date: |
Fri, 11 Jul 2014 22:56:07 -0500 |
Hello David,
Thanks for the utility.
May I suggest a minor tweak?
' e: show names having any character not in set'
should read
' e: show names having only characters not in set'
The former implies
]nlf e ⍙
would list, for instance, ⍙class, because c, l, a, and s are not in the
set ⍙, while in reality ⍙class is not listed because it contains ⍙, a
character in set.
Regards,
Fred
Retired Chemical Engineer
On Fri, 2014-07-11 at 11:30 -0700, David Lamkins wrote:
> Here's a more developed version of the utility functions I posted a
> few days ago. I've added a ]usercmd wrapper.
>
> ⍝!
>
> ∇z←⍙class ni ⍙set
> ⍝ Return a character array of every workspace name which includes
> ⍝ all characters in ⍙set. The empty set matches everything. The
> ⍝ optional ⍙class argument selects results by name class; the
> ⍝ default is 2 3 4 (variables, functions and operators).
> ⍎(0=⎕nc '⍙class')/'⍙class←2 3 4'
> z←⊃{ (∧/⊃(⊂,⍙set)∊¨⍵)/⍵ }{ (∧\' '≠⍵)/⍵ }¨⊂[(1+⎕io)]⎕nl ⍙class
> ∇
>
> ∇z←⍙class ne ⍙set
> ⍝ Return a character array of every workspace name which excludes
> ⍝ any character in ⍙set. The empty set excludes nothing. The
> ⍝ optional ⍙class argument selects results by name class; the
> ⍝ default is 2 3 4 (variables, functions and operators).
> ⍎(0=⎕nc '⍙class')/'⍙class←2 3 4'
> z←⊃{ (~∨/⊃(⊂,⍙set)∊¨⍵)/⍵ }{ (∧\' '≠⍵)/⍵ }¨⊂[(1+⎕io)]⎕nl ⍙class
> ∇
>
> ∇⍙args nlf_ucmd ⍙line
> →(3>⍴⍙args)/help
> →(4>⍴⍙args)/disp
> →(~∨/4='234'⍳3↓⍙args)/disp
> 'class must be in 2 3 4'
> →help
> disp:
> →('ie'∊↑1↓⍙args)/inc,exc
> help:
> ((∧\' '≠⍙line)/⍙line),' i|e set [class]'
> →('?'≠↑1↓⍙args)/0
> 'Display workspace names'
> ' i: show names having all characters in set'
> ' e: show names having any character not in set'
> ' set: any of a-z, A-Z, 0-9, ∆⍙_¯'
> ' class: selects name class(es)'
> ' 2: variables; 3: functions; 4: operators'
> →0
> inc:
> →(3<⍴⍙args)/iwc
> ni ↑2↓⍙args
> →0
> iwc:
> (⍎¨3↓⍙args) ni ↑2↓⍙args
> →0
> exc:
> →(3<⍴⍙args)/ewc
> ne ↑2↓⍙args
> →0
> ewc:
> (⍎¨3↓⍙args) ne ↑2↓⍙args
> ∇
>
> ]usercmd ]nlf nlf_ucmd 1
>
>
> --
> "The secret to creativity is knowing how to hide your sources."
> Albert Einstein
>
>
> http://soundcloud.com/davidlamkins
> http://reverbnation.com/lamkins
> http://reverbnation.com/lcw
> http://lamkins-guitar.com/
> http://lamkins.net/
> http://successful-lisp.com/