Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.