Post Reply 
Saving expressions?
03-21-2020, 04:38 PM
Post: #8
RE: Saving expressions?
(03-21-2020 02:40 PM)toml_12953 Wrote:  
(03-21-2020 12:32 PM)CyberAngel Wrote:  Pascal restricts the type forever.
There's no such restrictions on HP Prime where you can freely reassign a free variable with your choice of content at any moment.
In COBOL one can do even better and overlap variables at will. Diaster waiting if your compiler can't handle it.
Fortran is (was?) quite restricted.

Pascal and C only restrict the type after you define a variable. You can use almost any letter or combination of letters you want. Defining the datatype ahead of time is considered good programming practice.

The ANSI/ISO standard for COBOL allows overlap of variables. Any standard-compliant compiler can handle it (almost all current compilers from mainframes to micros)

How is FORTRAN restricted? The default for variables starting with the letters I - N is integer but you can redefine them if you want. FORTRAN 90 only has these restrictions:

A variable name must start with an letter.
After that, the rest of the name can contain only letters (a-z), digits (0-9) or underscore.
A variable name can be no longer than 31 characters.

These don't seem like onerous restrictions to me. To be able to change the datatype stored in a variable at will isn't good programming practice. The increased flexibility is more than offset by the potential for errors.

If you don't understand what I just wrote (Fortran, etc)
then there is no one who could help you to see the point.
One more try:
I wasn't talking about the variable names (which are still very flexible, although some short ones are reserved), but about the contents, which can be reassigned. It's right there after the nice RPL of the HP-48G and later. I like them!
Those reserved names in the HP Prime is a restriction that serves a purpose. One just reads a few manuals , a few thousand web pages with nice examples and learns those about 10,000 Commands (counting the different argument amount overload) and it n a few years one can learn to program the darn thing.
What bugs me is the bugs.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Saving expressions? - Dands - 03-20-2020, 07:15 PM
RE: Saving expressions? - CyberAngel - 03-20-2020, 09:40 PM
RE: Saving expressions? - victorvbc - 03-21-2020, 03:30 AM
RE: Saving expressions? - Dands - 03-21-2020, 04:19 AM
RE: Saving expressions? - toml_12953 - 03-21-2020, 10:47 AM
RE: Saving expressions? - CyberAngel - 03-21-2020, 12:32 PM
RE: Saving expressions? - toml_12953 - 03-21-2020, 02:40 PM
RE: Saving expressions? - CyberAngel - 03-21-2020 04:38 PM
RE: Saving expressions? - Dands - 03-21-2020, 04:58 PM
RE: Saving expressions? - CyberAngel - 03-21-2020, 05:23 PM
RE: Saving expressions? - victorvbc - 03-21-2020, 06:48 PM
RE: Saving expressions? - Dands - 03-21-2020, 08:18 PM
RE: Saving expressions? - toml_12953 - 03-21-2020, 08:26 PM



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