Post Reply 
Program local variables issue
02-10-2020, 06:09 PM
Post: #6
RE: Program local variables issue
(02-10-2020 11:07 AM)Carlos295pz Wrote:  
(02-10-2020 02:25 AM)DrDarius Wrote:  It is my understanding that the variables, as locals, should be destroyed the very moment the program terminates.

Outside of any function, every variable is global, and the point of LOCAL and EXPORT is for a visibility change for the calculator. LOCAL can be omitted only outside the program, let's say they are local to the compilation (checkmate). Regarding visibility, they are not visible but still accessible through ProgramName.LocalVariableName
I got lost in the meanders of terminology, and didn't express myself clearly. I was thinking what I see from the OS level, and used "local" to describe variables that have focus set to inside of the module (alike mentioned before "static global"). Sorry for the confusion.
After your explanation I can see, though, that they are closer to being an equivalent of the public methods of the class... Smile

Thanks for explanations. I definitely learned something today.

(02-10-2020 02:25 AM)DrDarius Wrote:  The user manual has a section that explains HP PPL, read it before creating great confusion.
I did read the manual, more than once. In my opinion it leaves a lot to desire. It looks to me like it did not get enough of TLC. After I learn programming details of HP PLL, I can see that one can read between lines and deduce certain things and features.
(Example: find ma a word "persistent" in the manual used in the context of persistent variables. Or, I could not find any example of the local variable defined outside of begin/end block; all were exported.)

But now we're getting to the MO issues. For me a calculator is a tool which I can use to aid whatever I am working on. I don't worship it, and I don't have time to sit for hours and test whether certain things work or not. At least I want to minimize such events. At the same time, I want to use it efficiently.
I understand that there is a conflict here: the manual cannot be too advanced, because it's for the... well... a calculator. Thus, I would like to see an appendix describing advanced topics clearly and without any ambiguities.

What counts for me is efficiency and ease of use. Before prime I used C on TI84+CE, Python on NumWorks. In my opinion HP Prime beats both of those two despite inefficiencies of HP PPL. And I am planning on using it until something better comes around. (To all the readers of this post: sorry if I hurt somebody's feelings with somewhat cynical approach.)

But it's a subject for a long discussion. There is no need to bore other forum members.

Darius
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Program local variables issue - DrDarius - 02-10-2020, 02:25 AM
RE: Program local variables issue - DrDarius - 02-10-2020 06:09 PM



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