Post Reply 
Question on HVars
05-24-2015, 08:12 AM
Post: #1
Question on HVars
Hi
As far aus I understood from the very beginning user functions are cas programs. Studying the tooltip for HVars I noticed that user defined functions can be accessed by hvars("func",2).
However I don't see a cas program listed on calling HVars. Now I am confused. Is there an other type of functions I was not aware of?

Ist would be cool if someone could elaborate a bit more on hohe vars, functions, cas programs and the HVars list in general.


Thanks in advance. Slainte!
Find all posts by this user
Quote this message in a reply
05-26-2015, 04:33 PM
Post: #2
RE: Question on HVars
I'd like to push this one.
Find all posts by this user
Quote this message in a reply
05-27-2015, 09:38 AM
Post: #3
RE: Question on HVars
As a last attempt I try to be more precise with my questions.

Ok here is the problem:

In home I can define, say dd:=1. I am then asked if I would like to create user variable dd. If I accept dd shows up in var/user. Interesstingly the menu is program variables. HVars returns dd in a List.
Everything fine. (Maybe the fact that my numeric var is called a program variable is surprising)


Now still in home I define ee(X):=X. That is syntax error! Same with ee(x):=x.

In cas I can define a function. I can access it from home but it does not show up in HVars.

Question: what is it about user defined function in Home?
How do I define a user function in home at all?
What is the (obvious) difference on where I define a User function.


I hope someone might ne able to help.
Find all posts by this user
Quote this message in a reply
05-27-2015, 10:25 AM
Post: #4
RE: Question on HVars
The User Guide, chapter 22 (Functions and commands), and chapter 23,(Variables), may be useful. You've probably read through them already, but there's a lot of information, pertinent to your questions, to be found there.
Find all posts by this user
Quote this message in a reply
05-27-2015, 08:23 PM
Post: #5
RE: Question on HVars
Thanks.
Well, of course, I read the manual. I did not after the last firmware came out so I did check again.
I don't find answers to my questions. Or my questions did not get clear. I wonder why certain programs or variables show up in different locations. (var vs toolbox) I wonder why I have to use the define template in home, can use the function in cas, but can use f():= assignment in cas and use the program in home nontheless.
Use the template create a function in home. cc(X)=X^2. Type cc in cas and you see what looks like a cas program. Do it in home you get an error...
Goto cas define CCC as CCC(X):=X^3. Type CCC in cas. Looks the same as above. Do it in home now it says program(X,0,X^3)... Why? What is the difference? What is going on there and does it make any sense? Should the behaviour be unyfied?

I cannot believe that students appreciate that. For me it is still just obscure. I am eager to get friends with the prime, but it is a miracle to me. :-(

I hope the reasons for my post and my questions nature got clear!

cheers
Find all posts by this user
Quote this message in a reply
05-27-2015, 09:28 PM
Post: #6
RE: Question on HVars
You might start with Han's excellent article on the subject:

HP Prime Programming: Variable types and their priorities

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
05-28-2015, 09:53 AM
Post: #7
RE: Question on HVars
I have the feeling not being smart enough for proper communtication on this board. It feels like I cannot express my Point :-(
thanks a lot though! I will continue to struggle with the device and maybe I'll notice that all that mess makes sense or will accept it als god given and get used to it intuitively.
Why e.g. two ways to define a function ( with := in cas or the define-template ) have any beneficial properties if the functions can be used equally in home. But as described have different behaviour if only its name is typed.... If I want to look at a function defined with the template I have to go to memory(!) where my Variable is listed as a program (but) does not show up in prog, and if I look at the function the Template is openend again.... Why not making such things unified and have a program for a function.... dunno if HP dev are discussing their platform from a retrospective and if they see positive aspects in the points I am struggling with.

I feel lost because you guys don't get my point which obviously is my fault. I'll try to post more precisely and not so generally the next time I have problems.

Thanks again for reading
Find all posts by this user
Quote this message in a reply
05-28-2015, 11:02 AM
Post: #8
RE: Question on HVars
I like to help where I can, and learn where cannot.

The questions you were asking seemed pretty general, to me. So, I pointed attention to the related user guide content, which, sometimes, is not readily at hand; unlike the on-calc help descriptions.

Follow up responses seem to suggest that you may be wanting to know 'why' things perform as they do, rather than fundamentally 'how' they perform. Corporate psycho-semantics is not my forte, but this product has all of the marketing obstacles you might expect; andt we are left to explore it's intrinsic value, to the extent our individual interest may direct.

I think that a lot of us would like a dream machine hand held calc, that surpasses anything hp has provided, historically. The hp Prime wasn't designed to be that dream machine, rather we have the status quo.

I try to make the best of it, but I'm still learning, and trying to help where I can.
Find all posts by this user
Quote this message in a reply
05-28-2015, 02:49 PM
Post: #9
RE: Question on HVars
I've not answered you because your question is actually a very good one, but doesn't have a short answer and I've been thinking how to explain it. What you are basically describing is tied in with several other important considerations.

First, there is no direct support for a "function" object in the HP parser when it comes to allowing the user to directly define them. So having the ability to do abc(a,b,c):=a+b+c does not work as input. Why is this not supported?
a) because the original design of Prime started from the 39G (well, 38g - but we'll stick with the 39 for now). That is a solid design which works very well in providing some structure and consistency to the user interface (apps containing symbolic, numeric and plot views) as well as being VERY consistent with the way mathematics is taught to aid understanding - but it DID NOT allow the end user any sort of variable creation at all. This is something we wanted to change, but it will take a while to do it. Look at the progression.
  1. 39g - no user variables at all
  2. 39gII - creation of variables using the prompt on home screen
  3. Prime first release - matching the 39gII, but adding the "define" window. Also added the CAS**.
  4. Prime current release - adds ability to programmatically create application files and variables.
  5. Prime future releases - ???


The parser was implemented with the design that it would support pre-existing objects first. While we knew that at some point it would need to support arbitrary objects, it isn't just as simple as "turn a switch and make it work".

Objects start running into a fundamental design question: should the user need to manually manage files and directories in order to work with the device? Must the user **COMPLETELY** understand how directory location and position impacts the calculations they do (HP48 style) or else they have difficult understand why certain behaviors are happening? Should they be completely blocked from ever seeing a file/folder structure (iOS)? Or should they normally ignore files/folders and only see them if they really want to (Android)?

So now the question arises - when the user creates a variable, where does it go? Should they be forced to be manually switching locations/directories to manage where stuff is? How do they access it from elsewhere? How can you avoid creating unnecessary confusion in the target customer (which if you are reading a *calculator* discussion group you pretty much by definition ARE NOT the Prime's primary target customer)?

And now we get to...

b)**The CAS. This is where it starts to get problematic.

The CAS makes the assumption that everything is an object in a flat directory. It was designed with the idea that you have "sessions" that are saved/loaded/discarded every time you use it. That design works well for most CAS systems and is why most desktop math/engineering packages use it.

In those, everything lives within that session and once gone, doesn't exist elsewhere. Yes, you can manually save it, create modules, etc, but the normal use is a single session, single problem, single set of calculations type idea. As part of the standard operation, you have command ( restart() for example ) that will wipe everything. That concept doesn't sit well with the idea that the calculator "stuff" should stay until you decide.

Since the CAS allows you to define a function and store into a variable, we had to make 1 of 2 choices at that time:
  1. Do we isolate the CAS completely?
  2. Do we try the best to support using the CAS elsewhere in the system if you choose to do so?


There is a 3rd option which is "Why not base the whole system on the CAS and just have them learn how to do things right?" or "Why not just give every student a copy of mathematica?" or some variant therein.

That is about the worst possible thing you could do a student learning about mathematics and anyone who says otherwise has either been teaching the most amazing set of student in history, or has no real experience teaching everyone from level 6 on up. (Yes, there are schools at grade/level 6 already using prime to explore concepts and LOVING it). For a certain type of student, throwing something like mathematica at them *might* work, but for the large majority it just killed any chance they will learn anything about math. The basic problem is that it requires you to learn far too much *first* about how to interact with the software before you can even begin to use it (you've just lost anyone who wasn't already extremely motivated and interested in learning about math), or you've taught the few that are left that they don't really need to learn because the software will "do it for me".



That is the background information. Well, maybe some ranting too... Smile


(05-28-2015 09:53 AM)leprechaun Wrote:  Why e.g. two ways to define a function ( with := in cas or the define-template )

As from before, there is no support for "non-existant" objects yet. Nor is there yet a good solution for the "where does it go" question that we are happy with *yet*. The CAS assumes everything is an object. It makes no distinction between f(x):=x^2 and a 10000 line program function. They count as the same thing!

Until there is support added to create a function object in a unified way, it is currently stuck in a midway point that is not ideal because the CAS does one way, and the rest of the system can't support that same way yet.


So knowing that an object/variable is something you store into directly, does a function go in the toolbox where nothing in there can be stored into by name? Or is it a variable since it behaves just like any other variable?

You could easily argue each way quite convincingly. For the moment, we felt the best decision was to keep the CAS objects together under VARS, and the "Defines" in the toolbox. That very well might change however in the future as I agree it was not a perfect solution.

Quote:have any beneficial properties if the functions can be used equally in home. But as described have different behaviour if only its name is typed.... If I want to look at a function defined with the template I have to go to memory(!) where my Variable is listed as a program (but) does not show up in prog, and if I look at the function the Template is openend again.... Why not making such things unified and have a program for a function.... dunno if HP dev are discussing their platform from a retrospective and if they see positive aspects in the points I am struggling with.

When you go down to the lowest level, a function is something that takes input, and returns something. In this way it is like a program and is in fact implemented as such in the HP code, in the CAS, and in basically any other system I've ever seen.

So again, would it be grouped in as a program (which is really is) or as a function? What if you have a function that uses things normally used in a "program" such as IF THEN ELSE END statements and loops/control blocks? Would you count or qualify that as a program then? How can you understand the intent of the user there?

I agree that there needs to be more work around clarifying the distinction between a "function" and a "program" in the interface. There are places where it is not as clear as I'd like it to be. Hopefully, when/if there are future releases we can further address this issue.

Also - hopefully you haven't given up reading this long post by now! Big Grin

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-28-2015, 09:28 PM
Post: #10
RE: Question on HVars
Hello and thanks a lot(!) for taking the time to write that post. I know that typing was least Time consuming.
I Do not understand the whole story 100% but I got a much better idea of what problems are actually buried under the surface of the prime.

I noticed that I seem to have a tendency to project everything to a classic directory structure which slows my learning progress.
I got a vague idea of the problems you guys have to deal with when you have to find a way to make changes to the evolved prime.
I realized that I must be a more conservative person that I ever thought because I think 6 graders should do a lot but not use something like the prime for playing because I doubt that playing leads to greater success than working overall....
I like to play with the prime, but overall I wish for a tool that I can use if I have a problem at work or at home with a primary hobby. I am not using the calculator just for the fun. I seek an intuitive way to use it and with that I fail for weeks. No excuse, but maybe a reason for my subtile harshness which I apologize for.

I should simply use the Prime as often as possible and try to not get frustrated if things don't work or I get confused again. AND I do curiously wait for the things to come!

Thank you again
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: