Simple challenge in RPL, Extract the odd elements from a list
|
08-16-2017, 06:27 PM
Post: #5
|
|||
|
|||
RE: Simple challenge in RPL, Extract the odd elements from a list
(08-16-2017 01:41 PM)Werner Wrote: Werner's is probably the most flexible standard RPL approach you will find. It doesn't care if the total number of elements is even or odd, it leaves just the odd ones in the result. (08-16-2017 01:50 PM)pier4r Wrote: I though DavidM made a command to specify multiple position to pick elements from a list (like { 3 5 7 9 11 13 } { 2 4 } LGET -> { 5 9 } . Note that in this case LGET would be short of a sort of generalized SUB ) but it is not the case, so at most one can use LHDTL to go through the list. If I was to use the ListExt library AND I knew that number of objects in the list was even, I would use this to extract the odd ones: Code: 2 LDST HEAD Code: LDST LRLL HEAD |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)