UserRPL: Need advice

  • Follow


	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
0
Reply Patrice 11/12/2009 7:13:19 AM

On 12 Nov., 08:13, Patrice <f...@home.fr> wrote:
> =A0 =A0 =A0 =A0 Hello all,
>
> =A0 =A0 =A0 =A0 I am new to the HP50G UserRPL and need advice.
>
> =A0 =A0 =A0 =A0 On PCs, I am used to use lists as container for variable =
structure of
> data with nested lists.
> aka
> =A0 =A0 =A0 =A0 {{1 2 3 {4 5}} {4 5 6 {7 8}} {9}} 'mylist' STO
>
> =A0 =A0 =A0 =A0 Do I have to write my own GET and PUT functions to access=
 the values or
> is it supported in some way?
> aka
> =A0 =A0 =A0 =A0 list {2 4 1} GET =A0-> =A07
>
> Thanks
>
> Patrice

0
Reply software49g 11/12/2009 8:06:57 AM


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

0
Reply software49g 11/12/2009 8:07:25 AM

<software49g@gmx.de> wrote in message 
news:854eaa84-4871-456f-a963-e434557853df@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
??? 


0
Reply Veli 11/12/2009 11:05:50 AM

Patrice wrote:

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

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

-Joe-
0
Reply Joe 11/12/2009 12:43:52 PM

	Hello,

	Thanks for answers.

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

Patrice

On Thu, 12 Nov 2009 08:13:19 +0100, Patrice <fake@home.fr> wrote:

>	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
0
Reply Patrice 11/13/2009 12:51:53 AM

	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
0
Reply Patrice 11/17/2009 12:22:52 AM

In article <ebq3g5558hjmmt96bfvvbmovfpsnqlqido@4ax.com>,
 Patrice <fake@home.fr> wrote:

> 	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

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.
0
Reply Virgil 11/17/2009 12:34:39 AM

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]
0
Reply John 11/17/2009 12:45:33 AM

Hello,

 >=A0 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.

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

0
Reply ISO 11/17/2009 12:57:49 AM

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]
0
Reply John 11/17/2009 1:30:03 AM

	Hello Andreas,

	I guess your answer is for SysRPL.

Patrice

On Mon, 16 Nov 2009 16:57:49 -0800 (PST), Andreas M�ller
<andreas_moellerNOSPAM@gmx.de> wrote:

>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.
>
>HTH,
>Andreas
>http://www.software49g.gmxhome.de
>http://www.youtube.com/watch?v=Pj72miclisM
0
Reply Patrice 11/17/2009 1:43:31 AM

11 Replies
220 Views

(page loaded in 0.135 seconds)

Similiar Articles:


















7/27/2012 6:20:31 PM


Reply: