Post Reply 
[HP 50g] Evaluation in algebraics
09-14-2014, 05:26 PM
Post: #4
RE: [HP 50g] Evaluation in algebraics
(09-14-2014 02:41 PM)ettlz Wrote:  Thanks for the link. In fact I think it's the runstream control stuff that I need. The point of this exercise to implement a function with optional arguments (which can be done in User RPL thanks to the Virtual Stack stuff -- just call DEPTH -- but only if that function's only used in algebraics; it obviously gets messy when called elsewhere).

You could probably call some of the Virtual Stack commands with SYSEVALs, but they're normally only used from SysRPL (as opposed to User RPL). Runstream control as well, and many of the runstream commands don't really apply outside of a SysRPL context.

One way to handle optional arguments in User RPL code is to put the optional parts in a list. Many of the built-in functions already know how to deal with that type of operation, so it could even simplify your code. In that context, the list itself implies the depth of the optional parts. A similar alternative might be to use a "meta structure", where you place your arguments on the stack and then a number in stack level 1 to designate the actual argument count. Both of these methods have their own strengths depending on the situation.

Hope this helps!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[HP 50g] Evaluation in algebraics - ettlz - 09-13-2014, 01:32 PM
RE: [HP 50g] Evaluation in algebraics - DavidM - 09-14-2014 05:26 PM



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