[Jprogramming] listatom equivalent of boxopen

Sherlock, Ric R.G.Sherlock at massey.ac.nz
Fri Jun 22 12:35:07 HKT 2007


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".
...
> and so I came up with this which seems to do the job.
> listatom=: ,^:(#@:$ = 0:)

RH> la1=: ,^:(0=#@$)
RM> la2=:,0&#
CB> la3=:1&# 
 
Thanks I knew there must be simpler ways!!


More information about the Programming mailing list