Post Reply 
Prime lags after extensive processing
03-18-2015, 06:53 AM
Post: #44
RE: Prime lags after extensive processing
Hello,

Quote:A passionatly written book would be really helpful and needed. Not only listing all possible commands but spicing them with further explanations and examples.

Like Jim's donnely's book for the 48?
Good idea, but honestly, but remember that Jim's wrote his book at least after the HP48SX Rev E came out, and maybe around the time of the 48GX, so, quite a while later. Before that, he was too buzy fixing bugs in the calculator itself to write the book...



Quote:You use L1 in your example.
Local variables should of course be used in a program. I used L1 as it makes it unambiguous that I wanted to work with a list at this point.

In a ToUpper, you will have to extract the ascii values of each of the string characters. There is no ways that a user program can do this faster than L1:= ASC(s);
The times it takes to allocate the list (a 1 of operation) will be minimal.

return CHAR(L1-((97<=L1) AND (122>L1))*32);

Then, you will need to test the numbers. Once again, using the list processing functionality will be faster than doing it programmatically in a user loop...
The final CHAR will also help as there is no need to constantly copy the string, as characters get modified one at a time as the CHAR function is 'atomic'...

The only thing that I do not like in this program is that AND... it is sad that the a<b<c trick does not work on lists... hey, anyway that a<b<c is a hack for ease of typing sake and is not perfect.


Quote:I try really hard to get used to your variable system
Now you are making me curious, what is confusing here?
Not that I think that there is no room for confusion, but if they are obviously confusing things, I would like to make sure that I understand what they are so that proper "deconfusing" documentation can be added in the appropriate places.


Quote:The confusing balance between home and cas
I do not know if you are familiar with the 38/39g series of calculators, but Prime was designed to be a '38/39g' successor with a charter to make it similar enough to allow users familiar with the 38/39 to use prime easily and so that we could reuse past documentation.
The Cas came from Bernard Parisse.
Now, I know that lots of management type persons thinks that you can 'just take 2 pieces of SW from the internet, slap them together and 'bamm', you have a working product'...
They forgot the rule one of addition in physics: what do you get when you add 3 carrots with 2 apples... At best a Wired Hybrid.

Quote:Why typed build in variables?
The 38/39 was designed as a teaching calculator, designed to be used by student, some of them with very little understanding of math, and even less of programming (and no interest in it whatsoever).
So, the designers of the time (Jim was one of them BTW), working with teachers decided that it would make sense and remove confusion to have a certain number of fixed typed variables for the user. Note that the user they had in mind was not a programmer. At the time, they had no CAS and a much simpler calculator than what we have now...
We inherited this design, but tried to add more stuff. Real programming for a start, so that added program global (static and exported) and local variables. We added stuff like the spreadsheet and geometry which dynamically create variables. We added function defines and user global variables.
The stuff that we added was to deal with the more 'advanced users', it is much more flexible than the rigid 38/39 but the rigid 38/39 is still there. The net total is something that is a hybrid. The hope is that a 'basic' user will not see the extensions and will stay in a 'simple' world (as in a word where things are simple to use, where typing something wrong generates an error), while the advanced user has access to all the niceties of a modern system.

The problem is that the person who is in the 'learning' part gets confused by the hybrid flavor of things.

Now, 'please roll the drums', let us introduce the CAS in it! with it's all paradigm for things! At the beginning, the CAS was separate, with little to now interactions with the rest of the system. It made it nice, clean and, because it was separate, just like an 'app' running on the system.
Of course, users wanted to be able to use the CAS form home, home from the CAS and generally break the wall. Well, we started working, as best as possible, to allow these communications, making them as seamless as possible. But it does not always work, especially in advanced or subtle cases. For most normal use (ie, doing a math calculation), there is no issues... However, in advanced stuff, such as programming (your definition of advanced may vary), issues prop up.
For example, does CasFunction(expression) mean that you want to execute CasFunction on the result of expression or the unevaluated expression? no way for home to know that.
The CAS is comfortable with pure 'unexistant' variables. In a programming language, this is of course a semantic error. Once again, 2 worlds collide.

What about a local variable? The CAS does not have access to it, so it gets replaced before calling the CAS. The result is that
Derive('a*b*x', 'x') with a=1, b=2 and x=3 will cause Derive('1*2*3','3') to be passed to the CAS... Not what you want...

Anyhow, I could continue there for ages, but I hope that you understand some of the issues at stake there.



Cyrille
Not speaking for HP when posting here...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Prime lags after extensive processing - cyrille de brébisson - 03-18-2015 06:53 AM



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