Post Reply 
Programming puzzles: processing lists!
06-15-2017, 06:21 PM
Post: #159
RE: Programming puzzles: processing lists!
I thought that it might be worth a few more bytes to have two more special-purpose commands that could be wrapped around the same core that's at the heart of LROT: LRLL (List Roll) and LRLLD (List Rolldown). These are functionally equivalent to 1 LROT and -1 LROT, but faster since the amount of rotation doesn't have to be computed from an argument. It also seemed to me that a rotation of 1 or -1 would be common enough to warrant a separate command for those purposes.

The names were chosen to coincide with similar RPL stack-based functionality. LRLL does the same thing as
Code:
\<<
   LIST\-> \-> 'lsize'
   \<<
      lsize ROLL lsize \->LIST
   \>>
\>>

LRLLD is the same, just replace ROLL with ROLLD.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming puzzles: processing lists! - DavidM - 06-15-2017 06:21 PM



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