For Programmers: Free Programming Magazines  


Home > Archive > APL > November 2004 > Selective nesting









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Selective nesting
Ric

2004-11-30, 8:55 pm

Let's say I have the following vector of nested strings in APL+WIN

x{<-}'aaa' 'bbb' 'ccc' 'ccc' 'ddd'

I want to nest those that are the same eg.

..…---------------------.
|.…-..…-..…-------..…-.|
||aa||bb||.…-..…-.||dd||
|'--''--'||cc||cc||'--'|
| |'--''--'| |
| '¹-------' |
'¹---------------------'

One option is to use dyadic enclose to nest all of them

(x{iota}x){enclose}x

..…---------------------------.
|.…---..…---..…-------..…---.|
||.…-.||.…-.||.…-..…-.||.…-.||
|||aa||||bb||||cc||cc||||dd|||
||'--'||'--'||'--''--'||'--'||
|'¹---''¹---''¹-------''¹---'|
'¹---------------------------'

And then selectively disclose the ones with shape of one, but that's
got me stumped too! Any pointers?

Thanks.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com