Sherlock, Ric wrote:
I was looking for a phrase that would make an atom (rank 0) into a
1-item list, but leaves anything else "as is".
Something like this but without the control structure.
if. 0=#$y do. ,y end.
I searched as much as I could through Wiki, forum and J system, but had
no luck. I may well have been searching for the wrong words!
Anyway I figured that what I wanted was essentially the same as the
boxopen verb
boxopen=: <^:(L.=0:)
and so I came up with this which seems to do the job.
listatom=: ,^:(#@:$ = 0:)
Are there other simpler ways of doing this?
listatom=: 1&#
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm