Post Reply 
Picking Out Elements Using a Logical List
08-16-2015, 11:53 AM
Post: #3
RE: Picking Out Elements Using a Logical List
Here is a method without a for loop:

Code:

export BOOLLIST3(LA,LB)
BEGIN
 local LC:={};
 local s:=size(LA);
 IF LB(1) THEN LC(0):=LA(1);END; 
 IF s==1 THEN return LC;end;
 LC:=concat(LC,BOOLLIST3(SUB(LA,2,s),CONCAT(SUB(LB,2,SIZE(LB)),LB(1))));
END;

Don't know if it qualifies as simple or not; it runs substantially slower than your version.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Picking Out Elements Using a Logical List - roadrunner - 08-16-2015 11:53 AM



User(s) browsing this thread: 1 Guest(s)