Agreed. But for completeness "nl" should list these names if they are
defined globally, particularly to avoid confusing new users. If (4!:1) is
run tacitly then the names can be listed. Starting from the definition of
"nl", something like the following accomplishes this.
By the way. Noticed that the definition of "names" is defined as (list_z_ @
nl). Shouldn't it be (list_z_ @ nl_z_)?
NB.*nl v selective namelist
NB. Form: [mp] nl sel
NB.
NB. sel: one or more integer name classes, or a name list.
NB. if empty use: 0 1 2 3.
NB. mp: optional matching pattern. If mp contains '*', list names
NB. containing mp, otherwise list names starting mp. If mp
NB. contains '~', list names that do not match.
NB.
NB. e.g. 'f' nl 3 - list verbs that begin with 'f'
NB. '*com nl '' - list names containing 'com'
nl1=.(([:4!:1])&(]`(0 1 2 3"_)@.(0=#))) :: cutopen_z_
nl=:(nl1 : ((4 : 0)nl1)) f.
if. 0 e. #y do. y return. end.
if. #t=. x -. ' ' do.
'n s'=. '~*' e. t
t=. t -. '~*'
b=. t&E. &> y
if. s do. b=. +./"1 b
else. b=. {."1 b end.
y=. y #~ n ~: b
end.
)
On Sun, Sep 25, 2011 at 11:16 AM, Raul Miller <[email protected]> wrote:
> On Sat, Sep 24, 2011 at 5:53 PM, Christopher McIntosh
> <[email protected]> wrote:
> > When defining global variables named "x" or "y" they do not show up when
> > using the *names* verb (and its associated verb, *nl*) from the z
> library.
>
> Arguably, it's bad practice to use global values with any of these names:
> m n u v x y
>
> These names have special meanings for J, and using them globally is
> likely to confuse people.
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm