List Commands Library for 50g
|
09-06-2017, 02:22 PM
Post: #119
|
|||
|
|||
RE: List Commands Library for 50g
(09-06-2017 01:52 PM)3298 Wrote: Don't mind me, I'm just dropping some semi-relevant SysRPL code including a wall of text, just as I usually do. I'm actually using a variant of that technique quite a bit in the library -- instead of ticR (which returns the boolean), I've been using 'R (which only returns the object). I actually learned the technique when tracing through one of the built-in routines (probably DOLIST), and it is indeed a nice way to handle things in certain cases. For small lists, it's actually slightly slower than "explode/ROLL/ROLLD", but the difference isn't great enough to make up for the benefits it provides. In particular, it's very nice as a means to almost have a "spare stack" to draw objects from that doesn't cause you to have to juggle others. And as list sizes grow, its measurably faster than the ROLL/ROLLD sequence. I have used it quite a bit in the library for places where I simply need a "sequential pump" of list elements. I'll check to see if I can change some of these to the indefinite structure with ticR, as I suspect I might be able to tweak performance a bit with that in some cases. Please continue to chime in with these suggestions! Although I already knew of this one (or its cousin), there's tons that I don't. I occasionally see things like this when tracing code with Nosy, and it can take a bit to figure out what it's for. This one caused me some head scratching until I actually copied some of the code and stepped through it to understand it better. That's also how I discovered the usefulness of OBJ>R some time back. It's documented well enough, but I simply hadn't noticed it until I saw it used in some firmware code. So tips and pointers such as yours and Joe's aren't just welcomed, they're hoped for. Thanks! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)