Well, if you really need it, here's a tacit version that should work:

   nlmonad =: [: cutopen_z_`(4!:1)@.(1 4 8 e.~ 3!:0) ((0 1 2 3"_)^:(0=#))
   nldyad =: (4 :0 nlmonad)
nms=.y
if. #t=. x -. ' ' do.
  'n s'=. '~*' e. t
  t=. t -. '~*'
  b=. t&E. &> nms
  if. s do. b=. +./"1 b
  else. b=. {."1 b end.
  nms=. nms #~ n ~: b
end.
)
   nl =: nlmonad : nldyad

nlmonad does all the name-getting work, and then feeds its result to nldyad
if nl is called dyadically (nldyad is just the copy-pasted code from nl).
Note that you might want to define nlmonad and nldyad locally, then define
nl globally and flatten it using f. .

I still strongly recommend that you don't use code that does anything
related to x, y, u, v, m, or n outside of explicit definitions. If there's
some unavoidable inconsistency, removing (<,'x') and (<,'y') from the result
of namelist will also do the trick.

Marshall

On Mon, Sep 26, 2011 at 2:40 PM, Raul Miller <[email protected]> wrote:

> On Mon, Sep 26, 2011 at 2:06 PM, The Geeko <[email protected]> wrote:
> > Raul Miller <rauldmiller <at> gmail.com> writes:
> >>
> >> Then you would build up a tacit expression using your new word(s), to
> >> replace nl.
> >
> > Aha!  Which seems to me to be a best-practice, anyway, right?
>
> It's a best practice, yes, though also a design decision -- for
> utilities provided by the language there can also be some value in
> minimizing the number of exposed names as well as some value in "just
> get something working that people can use".
>
> And, even for things that were created in 1989 (or whenever) there can
> be some value in not breaking other things that depend on old code.
>
> Anyways: best practice, yes, but with (hopefully minor) potential
> risks and issues.
>
> FYI,
>
> --
> 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

Reply via email to