I should've asked for the definition of nl , too. For comparison, here is
the definition of names from my J session:
names
[EMAIL PROTECTED]
nl
3 : 0
'' nl y
:
if. 0 e. #y do. y=. 0 1 2 3 end.
if. 1 4 8 e.~ 3!:0 y do.
nms=. (4!:1 y) -. ;: 'x y x. y.'
else.
nms=. cutopen_z_ y
end.
if. 0 e. #nms do. return. end.
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.
)
This last code block (in if. #t ... ) fulfills the semantics I described.
Note the E. in particular, which indicates 'is'&names will look for names
containing the substring 'is' , not the individual characters 'i' or 's'
.
I'm running J601c, but I just checked J601a, and the definition is the same.
So something else is wrong. Can you provide a simple demonstration of the
problem? For example, do this in a J session and post the results:
foo00_xxx_ =: 0:
Xfoo00_xxx_ =: 1:
fXX00_xxx_ =: 2:
Xoo00_xxx_ =: 3:
'foo' names_xxx_ 3
foo00
'*foo' names_xxx_ 3
Xfoo00 foo00
These are the correct results for the semantics I described. If names were
returning all names containing any of the characters in x , then 'foo'
names_xxx_ 3 would've returned all the names defined on the preceding lines.
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm