Post Reply 
newRPL: [UPDATED April 27-2017] Firmware for testing available for download
02-10-2017, 11:29 PM (This post was last modified: 02-10-2017 11:33 PM by Claudio L..)
Post: #550
RE: newRPL: [UPDATED January 31-2017] Firmware for testing available for download
(02-10-2017 08:53 PM)The Shadow Wrote:  
(02-10-2017 07:31 PM)Claudio L. Wrote:  Well, since there's 2 people vouching for user flags, I don't see why not implement them (2 people is probably 25% of newRPL's total user base, so it's a lot Smile


Now that's what I call service. Smile

Something else I've been pondering... I've hardly ever used STO+, INCR, and other commands of that type. But I can definitely see uses for local variable equivalents!

There's no need. You only need to use LSTO when you create the local variable, once you know it's been created, all other "normal" STO variants and INCR can be used and will properly find the local.
Having said that, using INCR may not be the best choice, for example let's compare:
<< 3 'N' LSTO N 1 + 'N' STO >>
vs.
<< 3 'N' LSTO 'N' INCR DROP >>

The first version internally is compiled to something like this (you won't ever see it, though):
<< 3 'N' LSTO 1GETLAM 1 + 1PUTLAM >>
The version using INCR will first push the name on the stack, then search by name, does the same 1 + (about the same speed as running 1 + in RPL code) and stores the result directly.
The version with GETLAM/PUTLAM doesn't do the search by name, so it is faster in the end.

The optimization is only done when using LSTO or STO, and when using RCL, LRCL or the name of the variable unquoted. All other commands like STO+, etc. are not subject to optimization with locals.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL: [UPDATED January 31-2017] Firmware for testing available for download - Claudio L. - 02-10-2017 11:29 PM



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