Post Reply 
HP Prime
09-01-2014, 07:35 PM (This post was last modified: 09-02-2014 09:40 PM by d b.)
Post: #21
RE: HP Prime
Of course, everyone knows how to convert kg to eV. My point is different.

A useful addition to the Prime, someday, would be to have physical constants available in units of eV and well as J or kg. Not a real big deal, but in the example of electron or proton mass, this would save having to use two conversion factors, e (1.6E-19) and c^2.
Find all posts by this user
Quote this message in a reply
09-02-2014, 08:22 AM (This post was last modified: 09-02-2014 08:24 AM by oldhpfan.)
Post: #22
RE: HP Prime
(09-01-2014 05:50 PM)gbh Wrote:  Okay; we're making progress. I appreciate all the help. I'll look into Pascal.

One important difference: Pascal is a strongly typed language, PPL is not.
so in PPL:
Local i;
i:=1;
i:=1.2;
i:="abc";

are all legal and ok to do.

In Pascal:
var i:int; //defines i as an integer variable
i:=1; //ok 1 is an integer
i:=1.1; //error 1.1 is a real number
i:="abc"; //error "abc" is a string

so when looking at program examples in Pascal keep this in mind. Strongly typed languages will tend to reduce programming errors, on the other hand you have to do type casts if you need to go from one thing to the other e.g. from a real to an integer, in PPL they are the same thing. It can be useful when writing non trivial programs in a PPL like language to adopt conventions such as appending something like _i to all variables that are supposed to be integers; _r to all variables that are supposed to be real; _s to all variables that are supposed to be stings, then if you find yourself doing something like pi_r:="3.14" than you need to ask yourself why you are assigning a string to something that is supposed to hold a real number.
Find all posts by this user
Quote this message in a reply
09-02-2014, 03:50 PM
Post: #23
RE: HP Prime
Thank you. this information is very helpful. I will try your scheme for typing of variables.

Maybe you can answer another question, from earlier in this thread, that got overlooked as the discussion focused on the Prime manual:

How do I enter or invoke one of the physical constants (e.g. Avogradro number or Planck constant) that are stored in the Prime in a PPL program? If this is in the manual, I can't find it.
Find all posts by this user
Quote this message in a reply
09-02-2014, 04:26 PM
Post: #24
RE: HP Prime
(09-02-2014 08:22 AM)oldhpfan Wrote:  One important difference: Pascal is a strongly typed language, PPL is not.
... Strongly typed languages will tend to reduce programming errors, on the other hand you have to do type casts if you need to go from one thing to the other e.g. from a real to an integer, in PPL they are the same thing.

For what it's worth, you can obtain the benefit of typed variables in PPL by using the built-in variables (which are strongly typed) instead of creating your own. For example:
  • A through Z can only contain real numbers
  • Z0 through Z9 can only contain complex numbers
  • G0 through G9 can only contain graphics
  • L0 through L9 can only contain lists
  • M0 through M9 can only contain arrays (vectors or matrices)
So if you really do want strongly typed variables, they are available in PPL.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-02-2014, 07:37 PM
Post: #25
RE: HP Prime
(09-02-2014 04:26 PM)Joe Horn Wrote:  
(09-02-2014 08:22 AM)oldhpfan Wrote:  One important difference: Pascal is a strongly typed language, PPL is not.
... Strongly typed languages will tend to reduce programming errors, on the other hand you have to do type casts if you need to go from one thing to the other e.g. from a real to an integer, in PPL they are the same thing.

For what it's worth, you can obtain the benefit of typed variables in PPL by using the built-in variables (which are strongly typed) instead of creating your own. For example:
  • A through Z can only contain real numbers
  • Z0 through Z9 can only contain complex numbers
  • G0 through G9 can only contain graphics
  • L0 through L9 can only contain lists
  • M0 through M9 can only contain arrays (vectors or matrices)
So if you really do want strongly typed variables, they are available in PPL.

Good point, but they are global variables which entails problems too also the names are not very intuitive, of course in small programs it makes little difference. Overall PPL does not look like a highly structured language to me, but then I never really expected one in a calculator.
Find all posts by this user
Quote this message in a reply
09-02-2014, 07:55 PM
Post: #26
RE: HP Prime
(09-02-2014 03:50 PM)gbh Wrote:  Maybe you can answer another question, from earlier in this thread, that got overlooked as the discussion focused on the Prime manual:

How do I enter or invoke one of the physical constants (e.g. Avogradro number or Planck constant) that are stored in the Prime in a PPL program? If this is in the manual, I can't find it.

Keep in mind I just started playing with this, I don't even get my Prime until Thursday.
But one way is do like this:
EXPORT Test1()
BEGIN
local pi, c_r;
c_r:=299792458_(m/s);
c_r:=c_r*c_r;
MSGBOX(c_r);
pi:=π;
pi:=pi*pi;
MSGBOX(pi);
END;

To insert the constants I just used the Units/constants menu to insert the appropriate constant as I was typing the program.
Find all posts by this user
Quote this message in a reply
09-02-2014, 09:28 PM
Post: #27
RE: HP Prime
(09-02-2014 07:37 PM)oldhpfan Wrote:  
(09-02-2014 04:26 PM)Joe Horn Wrote:  For what it's worth, you can obtain the benefit of typed variables in PPL by using the built-in variables (which are strongly typed) instead of creating your own.

Good point, but they are global variables ...

OH NO! <smacks forehead> Rats, I had assumed that A as a local variable would be reals-only, just like the built-in global variable A. But I just tried it, and it turns out that all local variables can contain any object type, regardless of the name! Well, phooey. Sad

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-02-2014, 09:56 PM
Post: #28
RE: HP Prime
This way one may easily reach the point where it will last longer to look up a constant expressed in special units than calculating it from some really basic constants oneself. Wink

d:-I
Find all posts by this user
Quote this message in a reply
09-03-2014, 12:26 AM
Post: #29
RE: HP Prime
(09-02-2014 09:28 PM)Joe Horn Wrote:  
(09-02-2014 07:37 PM)oldhpfan Wrote:  Good point, but they are global variables ...

OH NO! <smacks forehead>

I'm sure I'll be doing a lot of that myself Smile.
Find all posts by this user
Quote this message in a reply
09-05-2014, 08:48 PM
Post: #30
RE: HP Prime
(09-01-2014 03:42 PM)Tim Wessman Wrote:  Pascal most likely as pointed out. Really, we tried to make it so it would feel pretty universal and if you'd used any programming lanugage it will make sense just looking at it.
Most people seem to end up saying like BASIC, but I agree that it looks more like Pascal.

As to universal: *BUZZ* WRONG answer. You should have based on C/C++/Java/C#/javascript style syntax then, all of which are very similar syntactically. Pascal is pretty much dead.

50G AUR: probably has the long list of authors as I'd bet that it's derived from the PRINTED AUR that we got with our 48SXs(as I recall, got EVERY manual PRINTED AND a reference pamphlet as well) whic was probably then adapted for the 49G then the 49G+ and then the 50G which is why I always say that even my old 48 manuals(unfortunately the 48SX walked away... I miss it -> VAST disappointment in 49G (cruftily godawful build quality/kb was crap/sw was OK)) that I still have have some use even with 49/50 series.

The 49G was also the first HP calc that I purchased that came with the useless pamphlet of a manual, fortunately as alluded to above I still had my 48 manual set which mostly applied. Then the 50G and Prime were even worse with: WTF did you bother to include those useless marketing blurbs aka what passes for a printed intro guide. I REALLY miss printed manuals when they are (a) WELL written and (b) USEFUL which applies to alot of gadgets. Reading PDFs on a tablet just doesn't cut it for me, and being able to search is not much of a feature as any well written manual IMNHO includes a comprehensive index.

*AHEM* ... ao... anyways...
Find all posts by this user
Quote this message in a reply
09-05-2014, 11:44 PM
Post: #31
RE: HP Prime
(09-05-2014 08:48 PM)cutterjohn Wrote:  50G AUR: probably has the long list of authors as I'd bet that it's derived from the PRINTED AUR that we got with our 48SXs (as I recall, got EVERY manual PRINTED AND a reference pamphlet as well) ...

IIRC, the AUR wasn't included with the price of the 48. It cost extra.

Included with every 48:
Quick Reference Guide (tiny; fit in calculator case)

Included with every 48S and some SX's:
HP 48 Owner's Manual (single volume, 00048-90091)

Included with the other 48 SX's:
HP 48SX Scientific Expandable Owner's Manual (two volumes, 00048-90001 & 00048-90003)

OPTIONAL for 48 S/SX:
HP 48 Programmer's Reference Manual (one volume, 00048-90054)

Included with every G/GX:
HP 48G Series User's Guide (one volume, 00048-90126)

OPTIONAL for 48 G/GX:
HP 48G Series Advanced User's Reference Manual (one volume, 00048-90136)

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-06-2014, 02:31 AM
Post: #32
RE: HP Prime
Ah the good old days, I still remember my HP-25 and 67 manuals, those were great masterpieces.

As to Pascal being dead, don't tell the FreePascal, Lazarus and Delphi communities where programs can and are being written in Pascal...Long live Pascal. I wish PPL had more features from it, pointers would be nice, not to mention stack manipulation commands...and some good documentation too the full PDF manual seems to leave a lot out.

But as for printed manuals, I, these days, side with saving trees, but it's not like they can't be printed out with 2-up and duplex printing, printing two pages per side horizontally on one sheet is quite readable even to my old eyes (I only printed out a sample just to see how it would look). So I'd rather pay less and not get a printed manual, I just want a good manual with everything well documented and leave me to print it out if I want (and not everyone needs everything, my dad has no interest in programming I find the programming very interesting).
Find all posts by this user
Quote this message in a reply
09-06-2014, 03:01 AM
Post: #33
RE: HP Prime
I, who started this thread, have found the HP Prime manual somewhat better than I first thought.
And, the built-in help files are often useful. But, some basic things that could have been explained in the manual in a page or two are not mentioned. Just a few examples, of perhaps 20 or so that I've encountered so far:

(1) What does putting a variable in single quotes (e.g., 'X') mean, and why?

(2) == AND = are supposedly different, but = seems to work where == ostensibly would be required; e.g., (n=2) returns 1. Are = and == equivalent in some contexts and not others?

(3) Are := and the little right-pointing arrow (Store) always equivalent, or just sometimes?

(4) How to declare "locally global" variables and functions---those to be shared by all the subroutines of a program (without passing arguments in parentheses). Evidently such variables and functions are declared before the first Export Func() statement. I had to figure this out from examples on the internet, and I'm not sure I really understand it. A few sentences in the manual would clarify the procedure.

(5A) Most important of all, how is the lowest variable in the RPN stack (x, #1) accessed by or imported into a PPL program? The manual is strangely silent on such topics.

(5B) The manual says that Ans returns the last answer, but in fact it returns the last two operands, as a list. Why?

A useful supplement to the manual would be a long, complex program example, illustrating as many techniques and function as possible, with these features explicitly labeled by comments. The dice-rolling programs in the manual are a good start, but don't go far enough.

Earlier responses in this thread made me realize that the HP Prime is a "work in progress", not a finished product. So, I guess we're all doing HP's product testing for them. That's okay with me, as in the meantime the Prime is already a very cool and useful product (and an amazing assemblage of hardware and software for ca. $100). I just hope the next major task of the "work in progress" is to fix the interface between RPN and the rest of the system.
Find all posts by this user
Quote this message in a reply
09-06-2014, 03:27 AM (This post was last modified: 09-06-2014 03:27 AM by oldhpfan.)
Post: #34
RE: HP Prime
^yep +1
Find all posts by this user
Quote this message in a reply
09-06-2014, 03:49 AM
Post: #35
RE: HP Prime
(09-06-2014 03:01 AM)gbh Wrote:  (1) What does putting a variable in single quotes (e.g., 'X') mean, and why?

I think this is the same as that for the HP48: 'X' is the variable itself, whereas X produces the contents of the variable. (Perhaps I misunderstand your question)

Quote:(2) == AND = are supposedly different, but = seems to work where == ostensibly would be required; e.g., (n=2) returns 1. Are = and == equivalent in some contexts and not others?

Unfortunately, yes. The CAS environment sometimes handles = as ==.

Quote:(3) Are := and the little right-pointing arrow (Store) always equivalent, or just sometimes?

They are two different ways of doing exactly the same thing. The := syntax is much easier for those creating code on a PC (whose keyboard lacks the right-pointing arrow) whereas the arrow is readily accessible on the calculator (either via the menu or keystrokes).

Quote:(4) How to declare "locally global" variables and functions---those to be shared by all the subroutines of a program (without passing arguments in parentheses). Evidently such variables and functions are declared before the first Export Func() statement. I had to figure this out from examples on the internet, and I'm not sure I really understand it. A few sentences in the manual would clarify the procedure.

They just need to be declared before the function calling them, like with C/C++ functions. You do not necessarily have to declare before the first instance of EXPORT.

Here's my understanding of it: http://www.hpmuseum.org/forum/thread-216.html

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
09-06-2014, 06:47 AM
Post: #36
RE: HP Prime
(09-05-2014 08:48 PM)cutterjohn Wrote:  As to universal: *BUZZ* WRONG answer. You should have based on C/C++/Java/C#/javascript style syntax then, all of which are very similar syntactically. Pascal is pretty much dead.
The first version of the PPL was in the hp39gii, it was mostly an uppercase translation of the Xcas programming language, using keywords instead of ponctuation for obvious pedagogical reasons. The Xcas programming language is itself inspired by the maple language, itself inspired by Pascal and Algol.
Find all posts by this user
Quote this message in a reply
09-06-2014, 06:07 PM
Post: #37
RE: HP Prime
"I think this is the same as that for the HP48: 'X' is the variable itself, whereas X produces the contents of the variable."

"They just need to be declared before the function calling them, like with C/C++ functions."

Evidently the initial or primary market for the HP Prime is the education sector---students and their instructors. Then surely programming should be explained in the manual in a way that does not assume prior familiarity with the HP48 (the manual for which is unavailable) or C/C++?!
Find all posts by this user
Quote this message in a reply
09-10-2014, 03:10 PM (This post was last modified: 09-10-2014 03:10 PM by toml_12953.)
Post: #38
RE: HP Prime
Michael

Could I hijack the thread for this single post? I'd like to remind people that we still need about ten more commitments for another run of the printed, spiral bound copy of the HP50g AUR.

See: Advanced User's Reference - printed version

Count me in!

Tom L
USA

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-14-2014, 02:40 PM (This post was last modified: 09-14-2014 02:53 PM by cutterjohn.)
Post: #39
RE: HP Prime
(09-05-2014 11:44 PM)Joe Horn Wrote:  
(09-05-2014 08:48 PM)cutterjohn Wrote:  50G AUR: probably has the long list of authors as I'd bet that it's derived from the PRINTED AUR that we got with our 48SXs (as I recall, got EVERY manual PRINTED AND a reference pamphlet as well) ...

IIRC, the AUR wasn't included with the price of the 48. It cost extra.

Included with every 48:
Quick Reference Guide (tiny; fit in calculator case)

Included with every 48S and some SX's:
HP 48 Owner's Manual (single volume, 00048-90091)

Included with the other 48 SX's:
HP 48SX Scientific Expandable Owner's Manual (two volumes, 00048-90001 & 00048-90003)

OPTIONAL for 48 S/SX:
HP 48 Programmer's Reference Manual (one volume, 00048-90054)

Included with every G/GX:
HP 48G Series User's Guide (one volume, 00048-90126)

OPTIONAL for 48 G/GX:
HP 48G Series Advanced User's Reference Manual (one volume, 00048-90136)
My 48SX came with ALL of the 48SX manuals, but IIRC I bought it from the local independent university bookstore, so maybe they got "special" packages? It was quite a LARGE box that the 48SX came in and IIRC it looked like your typical HP box, and I also seem to recall that it came with more in the way of manuals than my 28S did, but I sold that as soon as I could afford(-28S selling price) a 48SX.

[EDIT]
@Parisse
Ah, that explains it. I like Pascal(2nd HLL language that I knew and taught myself when a kid which was real fun w/every compiler having it's own little dialect and each text their own as well, but I got used to that translating all of the BASICs to what I had). More modern Pascal seems to revolve around the Delphi dialect(especially OOisms tacked on), or at least as far that's fpc's goal, and gpc accomodates delphi mostly, but I hardly bother with Pascal any longer even though in many ways I still prefer it(probably comfort related).

Maple/XCAS/etc. Never bothered to program any of those as by the time that wouldv've been necesarry I'd just bang something out in C/C++/Java/Python/perl pretty quickly. (I know FORTRAN too which MIGHT be better for some things, but I REALLY DESPISE FORTRAN...)
[/EDIT]
Find all posts by this user
Quote this message in a reply
09-14-2014, 03:03 PM
Post: #40
RE: HP Prime
The Help button, although not perfect, helps.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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