prevent list evaluation
|
09-28-2015, 04:17 AM
(This post was last modified: 09-28-2015 04:18 AM by ji3m.)
Post: #1
|
|||
|
|||
prevent list evaluation
Is there any way to prevent a list from being evaluated when copied.?
e.g. fun1() and fun2() are compiled pgms. then a := { QUOTE (fun1),QUOTE (fun2) }; results in a:= {fun1,fun2} unevaluated. good so far. I use a as a function vector table. But then b := a; evaluates fun1 and fun2 I guess what i want is b := rcl (a) or something that just retrieves the value of a. I would like to prevent such evaluation while mechanically manipulating such lists. I work with android Prime only for now on my Galaxy Tab Pro/Note 2 |
|||
09-28-2015, 05:32 AM
Post: #2
|
|||
|
|||
RE: prevent list evaluation
Hello,
Is that in CAS or numerical? 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. |
|||
09-28-2015, 11:50 AM
(This post was last modified: 09-28-2015 02:34 PM by ji3m.)
Post: #3
|
|||
|
|||
RE: prevent list evaluation
Cas mode.
Home makes everthing numerical. I trying to manipulate objects rpl style. I work with android Prime only for now on my Galaxy Tab Pro/Note 2 |
|||
09-28-2015, 03:31 PM
Post: #4
|
|||
|
|||
RE: prevent list evaluation
Much confusion on my part.
If im in the cas window and type b :=a i get a bonus evaluation. But in home view this does not happen. a is copied to b. So in a program i dont get the extra evaluation. I read somewhere programs execute in the home mode. What does this mean? Is cas vs home only different in the command line parser? Its all very confusing. I work with android Prime only for now on my Galaxy Tab Pro/Note 2 |
|||
09-28-2015, 04:41 PM
Post: #5
|
|||
|
|||
RE: prevent list evaluation
So maybe I answered my own question
make a func export rust () begin 5959 end; Then in the cas window type a := {rust}; then type a which returns 5959 it evaluate rust. so I defined a general function export rcl (v) begin v end; So now rcl (a) returns 5959 as expected but. rcl('a') returns {rust} as desired I work with android Prime only for now on my Galaxy Tab Pro/Note 2 |
|||
09-28-2015, 07:40 PM
Post: #6
|
|||
|
|||
RE: prevent list evaluation | |||
09-28-2015, 08:16 PM
(This post was last modified: 09-28-2015 08:18 PM by ji3m.)
Post: #7
|
|||
|
|||
RE: prevent list evaluation
So the the cas command line parser thinks a list is not just a collection of objects (which it should be) but something with semantic meaning. (i dont know what that is)
But it is bent on evaluating all the elements in it . I dont know much about xcas So my function rcl ('a') does the job nicely. In rpl a stored list is not a program , but a data structure. There are also functions to evaluate element by element but its not automatic. A deeper flaw in ppl is the inability to nest blocks (and create locals) so it is not like any other language i know . Definitly not lisp,c,pascal,etc. I thought at first i might be able translate rpl to ppl (since i can now write programs from a program). But alas ppl is a weaker language than rpl. At this point my prime sysrpl emulator runs abot 10 times faster than on my hp50 emulator. Both Prime and HP50 Are running on Samsung Tab pro. There is a template for a block so i thought maybe it would work. But no. I work with android Prime only for now on my Galaxy Tab Pro/Note 2 |
|||
09-29-2015, 06:25 AM
Post: #8
|
|||
|
|||
RE: prevent list evaluation
Hello,
I believe that you can do anything in PPL that you can do in RPL, BUT NOT AS EASILY! RPL has much higher self referencing ability than PPL which gives it that extra power. Lambda functions would be nice :-) 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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)