Post Reply 
cross calling ppl and #cas ???
10-04-2015, 12:21 PM
Post: #1
cross calling ppl and #cas ???
So what are the argument and evaluation rules when

(1) a ppl function calls a #cas func
(2) a #cas function calls ppl
(3) a ppl fun passes cas variables

I get different results and sometimed brutsl crashes
depending on the args and functions.

I work with android Prime only for now on my
Galaxy Tab Pro/Note 2
Find all posts by this user
Quote this message in a reply
10-05-2015, 07:13 AM
Post: #2
RE: cross calling ppl and #cas ???
Hello,

Easy answer: I can't even remember!

Ok, looking in the code, here are the rules:
From PPL to CAS
- Parameters are NOT evaluated prior to the CAS call Unless it is a list
- All local variables in the parameters are replaced by their values (because CAS does not have access to local variables)
- Parameters which are Strings are parsed by the CAS parser
- CAS default variable is changed to X, Y and theta depending on the current app
- CAS function is evaluated
- CAS default variable is restored
- CAS Result is transformed into PPL construct and returned

from CAS to PPL
- All arguments are evaluated
- Arguments are transformed into PPL constructs and PPL function is called
- Result is transformed back into CAS and returned

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
10-05-2015, 03:27 PM
Post: #3
RE: cross calling ppl and #cas ???
I presume you mean the CAS (....) call.

How about calling a #cas function.. from ppl?

e.g.

#cas f (a,b):=......#end

then in ppl call f

a:= f (n,m);

Anything different here?

I work with android Prime only for now on my
Galaxy Tab Pro/Note 2
Find all posts by this user
Quote this message in a reply
10-05-2015, 03:36 PM
Post: #4
RE: cross calling ppl and #cas ???
(10-05-2015 03:27 PM)ji3m Wrote:  I presume you mean the CAS (....) call.

How about calling a #cas function.. from ppl?

e.g.

#cas f (a,b):=......#end

then in ppl call f

a:= f (n,m);

Anything different here?

He means all instances of calling a program or command name that is associated with the CAS side of things. So whether it is a function you created using #cas or a built-in CAS command, what Cyrille posted is an explanation of how inputs are parsed when calling a CAS command/program from within a PPL program or calling a PPL program from within a CAS program. The CAS() command is a PPL command as is the CAS.command() construct.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 




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