Did I miss this somewhere?  An alternative without inv.
   
   ,(>"0 z),' '
alpha  bravo  charlie

Linda


-----Original Message-----
From: programming-boun...@jsoftware.com
[mailto:programming-boun...@jsoftware.com] On Behalf Of Ric Sherlock
Sent: Monday, August 22, 2011 8:09 PM
To: Programming forum
Subject: Re: [Jprogramming] Flattening a list containing boxed elements

If you're after the J equivalent of APL's Enlist then this should do the
job:

   ; <@, S:0 test

or:
   enlist=: [: ; <@, S:0
   enlist test

On Mon, Aug 22, 2011 at 9:03 PM, Henry Rich <henryhr...@nc.rr.com> wrote:
> Not sure what you mean by flatten, but
>
>    ; < S:0 test
> 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
>
> Henry Rich
>
> On 8/22/2011 4:14 AM, Gregory Nisbet wrote:
>> I want to flatten a list containing boxed elements.
>>
>> a =: 1 ; 2 3 ; 4 5
>> b =: a ; a
>> a =: b ; b
>> test =: a ; b
>>
>> the array test thus contains many test boxes and was the ad hoc test 
>> case I was trying to flatten.
>>
>> flattening a multidimensional array is simple enough ,/^:_
>>
>> but thus far, I can't seem to figure out how to flatten test and 
>> other similarly convoluted nested boxes.
>>
>> It particularly baffles me that>  test and>"_1 test both result in
errors.
>> It seems like there's something simple I'm missing, but I can't quite 
>> figure out what.
>>
>> Any help would be much appreciated.
>> ---------------------------------------------------------------------
>> - For information about J forums see 
>> http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
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