Post Reply 
Programming puzzles: processing lists!
10-17-2017, 10:42 PM
Post: #209
RE: Programming puzzles: processing lists!
(10-17-2017 08:58 PM)pier4r Wrote:  The pick3 command is nifty, I am not used to use them (because I prefer to put stack objects in variables).

When operations involve juggling just 2-3 items on the stack, I don't typically go to the trouble to create variables. Especially as in cases like this, where the operations involved are just a few steps.

(10-17-2017 08:58 PM)pier4r Wrote:  I also added the code in the collection of userRPL code in the hp calc torrent. If you have code to suggest to add (or threads where to look for code), feel free to tell me.

I suppose sequences such as the above seem too isolated and specific to be considered "general purpose programs" to me. I would never think of putting something like that in a library/collection, because it seems more like a code fragment that just comes to mind naturally after one becomes familiar with the language syntax and constructs.

Considering the other example from above:

Over time, SWAP ROT has been implanted in my brain as a simple RPL combination to reverse the order of 3 stack elements. It's too short to turn into a separate program, and I've never written it down anywhere. It's just something that I remember after years of occasionally needing that type of construct while manipulating stack contents. Likewise, NDUPN →LIST is a "phrase" that is etched in my memory for building a list of repeated objects. From those simple building blocks, lots of similar functions to your above example could be created.

I suppose it's just a different way of thinking about programming, and one that feels more natural to me than trying to keep up with lists of short code snippets. It's probably just a stylistic difference in approach more than anything else.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Programming puzzles: processing lists! - DavidM - 10-17-2017 10:42 PM

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