Post Reply 
[question]userRPL, functions or (sub)subprograms and directories
03-29-2017, 04:42 PM
Post: #9
RE: [question]userRPL and functions or (sub)subprograms
(03-29-2017 03:37 PM)DavidM Wrote:  That's one way to approach it, but not exactly what I meant. Keep in mind that the default search path for objects on the 50g is "current directory or any parent directory of the current one". So you don't have to specify the full path if the item being referenced is located anywhere in that upward-looking default search path.

[...]Used properly, though, it can be quite powerful.

Yes, I agree that's quite powerful. I did not know this property of the interpreter. Is it defined in the manuals or is it something that the community discovered and was underdocumented?

Anyway I noticed a pretty useful usage of putting an additional nested program in a program. One can isolate code blocks to not execute them (in the case adding a "drop" after the nested program) or to debug them. That helps a lot.

Code:

\<<
  10
  11
  0
  \->
  uFlocal1
  uFlocal2
  funcCF
  \<<
    \<<
      @ it would work even with declaring again local variables and \-> plus a subprogram
       CF
    \>>
    'funcCF' STO
    
    uFlocal1 SF
    uFlocal2 funcCF EVAL
    
    uFlocal1 FS?
    "local flag 1 set?"
    \->TAG

    uFlocal2 FS?
    "local flag 2 set?"
    \->TAG
    
    
    \<<
      @pretty useful for toggling code inactive
      "code I'm not sure of, don't execute"
    \>>
    
    \<<
      @pretty useful to debug just portion of code
      "code I want to debug"
    \>>
    DEBUG
  \>>
\>>

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [question]userRPL and functions or (sub)subprograms - pier4r - 03-29-2017 04:42 PM
about DIR END - pier4r - 03-29-2017, 06:15 PM



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