HP Forums

Full Version: prevent list evaluation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Hello,


Is that in CAS or numerical?

Cyrille
Cas mode.

Home makes everthing numerical.

I trying to manipulate objects rpl style.
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.
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
(09-28-2015 04:41 PM)ji3m Wrote: [ -> ]...
So now rcl (a) returns 5959 as expected
but. rcl('a') returns {rust} as desired

So. How to prevent list evaluation ??? I hate this PPL, it is so weird and inconsistent :-(
quote(Symbol) - cannot be evaluated during copying in normal languages !
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.
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
Reference URL's