Post Reply 
forward declaration of variables?
10-12-2015, 05:29 AM
Post: #3
RE: forward declaration of variables?
Hello,

>It seems like ppl is uninventing well understood rules of scope.

No, all languages have their own rules for scope, and PPL has its own, slightly different, to adapt to the calculator case and system.

PPL recognizes 3 types of scope:
1) The system scope, which is anything that is already recognized by the system (ie, you can go to home or cas, type it, and it does something).
2) The current file or program scope (these are the same as 1 file is 1 program for PPL)
3) The current function scope

Notes:

1 can contain a number of USER defines objects, such as vars and functions from OTHER programs

2 At program scope level, you find program global variables. EXPORTED, or not (LOCAL) and program functions, once again, EXPORTED or not
Here LOCAL, if used means: Not exported. Probably a bad choice as local is also used in function.
Here you will also find forward declarations, but this is just a compilation trick to allow you to do double recursive functions. This is NOT designed to be like a C "function declaration".

3 at function scope, you find all the function local variables (including the parameters).


See, the PPL scope is well defined, BUT it is more complex that C or similar scope due to the fact that PPL programs execute, and are part of, the glogal calculator system.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
forward declaration of variables? - ji3m - 10-12-2015, 01:28 AM
RE: forward declaration of variables? - cyrille de brébisson - 10-12-2015 05:29 AM



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