listatom =: ,"1

Henry Rich 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sherlock, Ric
> Sent: Thursday, June 21, 2007 9:43 PM
> To: Programming forum
> Subject: [Jprogramming] listatom equivalent of boxopen
> 
> 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?
> ----------------------------------------------------------------------
> 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