Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UserRPL: Need advice

12 views
Skip to first unread message

Patrice

unread,
Nov 12, 2009, 2:13:19 AM11/12/09
to
Hello all,

I am new to the HP50G UserRPL and need advice.

On PCs, I am used to use lists as container for variable structure of
data with nested lists.
aka
{{1 2 3 {4 5}} {4 5 6 {7 8}} {9}} 'mylist' STO

Do I have to write my own GET and PUT functions to access the values or
is it supported in some way?
aka
list {2 4 1} GET -> 7

Thanks

Patrice

softw...@gmx.de

unread,
Nov 12, 2009, 3:06:57 AM11/12/09
to

softw...@gmx.de

unread,
Nov 12, 2009, 3:07:25 AM11/12/09
to
Hello,

the AUR which contains all USER-RPL-Commands is available at
http://www.hpcalc.org/details.php?id=7141.

You can use GET, GETI, PUT, PUTI with lists or arrays.

Be warned that list access is pretty slow because the list has no size
field and thus all access has to be done by slow searching through the
Composite Object.

However, there is a trick to speed up access of Composite Objects by
wrapping them into a Code Object which can be done at compile time but
this "costs" 10 Nibbles for each list and of course this can not be
done in USER-RPL.

Depending on your needs you might want to choose another "container"
for your variables. If you are only using real numbers an array maybe
a better choice.

HTH,
Andreas
http://www.software49g.gmxhome.de
http://www.youtube.com/watch?v=Pj72miclisM

Veli-Pekka Nousiainen

unread,
Nov 12, 2009, 6:05:50 AM11/12/09
to

<softw...@gmx.de> wrote in message
news:854eaa84-4871-456f...@w19g2000yqk.googlegroups.com...

> Hello,
>
> the AUR which contains all USER-RPL-Commands is available at
> http://www.hpcalc.org/details.php?id=7141.
>
> You can use GET, GETI, PUT, PUTI with lists or arrays.
>
> Be warned that list access is pretty slow because the list has no size
> field and thus all access has to be done by slow searching through the
> Composite Object.
>
> However, there is a trick to speed up access of Composite Objects by
> wrapping them into a Code Object which can be done at compile time but
> this "costs" 10 Nibbles for each list and of course this can not be
> done in USER-RPL.

Not even with DevLib functions like COMP-> ->LST
???


Joe Horn

unread,
Nov 12, 2009, 7:43:52 AM11/12/09
to
Patrice wrote:

>         {{1 2 3 {4 5}} {4 5 6 {7 8}} {9}} 'mylist' STO
>
>         Do I have to write my own GET and PUT functions to access the values or
> is it supported in some way?
> aka
>         list {2 4 1} GET  ->  7

list { 2 4 1 } 1 << GET >> DOLIST

-Joe-

Patrice

unread,
Nov 12, 2009, 7:51:53 PM11/12/09
to
Hello,

Thanks for answers.

I wrote 2 quick and dirty functions to suit my needs.

Patrice

Patrice

unread,
Nov 16, 2009, 7:22:52 PM11/16/09
to
Hello,

Me again :) still sharpening my skills in UserRPL

I reached the point "Make it right".
Now heading to the point "Make it fast".

Does anybody know about a table measuring speed of commands, telling
what is fast and how fast is fast, what is slow and how slow is slow.
For exemple, I have been told that named vars are slower than stack
operations but I don't know repective speeds.

Thanks in advance
Patrice

Virgil

unread,
Nov 16, 2009, 7:34:39 PM11/16/09
to
In article <ebq3g5558hjmmt96b...@4ax.com>,
Patrice <fa...@home.fr> wrote:

One way of finding out relative speeds is by using the TEVAL command.
It effectively mimics the EVAL command but appends the elapsed time for
evaluation to the stack.

Put a program which you wish to test on the stack, or its name if saved
in that directory or above, following any necessary inputs for that
program, then execute TEVAL.

John H Meyers

unread,
Nov 16, 2009, 7:45:33 PM11/16/09
to
On Mon, 16 Nov 2009 18:22:52 -0600, Patrice wrote:

> what is fast and what is slow

Data storing:

Fastest: Stack
Fast: Temporary (local) variables
Slow: User (global, permanent) variables
(particularly when variables change size or are created/deleted)


Calculation:

Fast: Real, Complex
Slow: Integer


Interfaces:

Fast: menu based
Slow: form based


Writing programs:

Some things that are slower to execute
may nonetheless make programming easier, faster,
and even safer (e.g. UserRPL itself).


> how slow is slow

In metric or English units?

[r->] [OFF]

Andreas Möller

unread,
Nov 16, 2009, 7:57:49 PM11/16/09
to
Hello,

>  For exemple, I have been told that named vars are slower than
stack
> operations but I don't know repective speeds.

Generally stack access is the fastest way as this is only a stack of
pointer where each pointer is 5 nibbles wide and generally stack
manipulating commands are PCOs (but some are secondaries - use Nosy to
find out what a kind a command is)

However, if there is a lot of stack movements than NULLAMS are faster,
loading the pointer to a NULLLAM in the range of 1 - 27 is very fast
(ca. 0,05ms according to EMU48) because this done trough one single
command, from LAM 28 it gets a little slower (because the #BINT is
needed).

Named LAMs are at least ten times slower as they are searched in
memory wheras NULLLAMS are calculated.

John H Meyers

unread,
Nov 16, 2009, 8:30:03 PM11/16/09
to
On Mon, 16 Nov 2009 18:57:49 -0600:

> PCOs, secondaries, NULLLAMS, BINT, ...

Interesting answers to a UserRPL question.

But there must be lots of SysRPL people reading anyway :)

[r->] [OFF]

Patrice

unread,
Nov 16, 2009, 8:43:31 PM11/16/09
to
Hello Andreas,

I guess your answer is for SysRPL.

Patrice

0 new messages