p =. (, {.) p

which is no better than your method.  But the straightforward

   p =. p , {. p

would benefit from append-in-place.

Henry RIch

On 7/26/2012 3:46 AM, Linda Alvord wrote:
Is there a simpler way to close a list by returning to the first element. My
two ways are:



     ]P=:'ABCDEFGH'

ABCDEFGH

    ]Q=:(>:$P)$P

ABCDEFGHA

    (>:#P)$P

ABCDEFGHA

    ]Q=:(>:$P)$P

ABCDEFGHA



    ]POLY=:2{\"1 Q

---T--T--T--T--T--T--T--┐
│AB│BC│CD│DE│EF│FG│GH│HA│
L--+--+--+--+--+--+--+---





----------------------------------------------------------------------
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