[comp.sys.handhelds] PRG-> and ->PRG

a634@mindlink.UUCP (Rob Prior) (10/09/90)

I remember there being a couple of programs for my 28s called PRG-> and ->PRG.
They functioned as follows:

on the stack:

4:
3:
2:
1:     << RCL DUP PURGE >>          (or whatever)

PRG-> executed would give:

6:                    <<
5:                   RCL
4:                   DUP
3:                 PURGE
2:                    >>
1:                     5            (this all being accomplished
                                     through the use of sysevals)

->PRG would take the stack in part 2 and give you what you started with.  After
all, we can get all of the symbols (<<, >>, RCL, etc.) onto the stack with
sysevals.  Is there a way to implement the same programs on the 48sx?  If
someone could post their solution, it would be muchly appreciated.

Thanks in advance,
Rob
--
 _______________________________________________________________
|Rob Prior - President, Still Animation Logo Design, Burnaby, BC|
|---------------------------------------------------------------|
|            Mail to: a634@mindlink.uucp                        |
|   ___  _        or: !uunet!van-bc!rsoft!mindlink!a634         |
|  /__  /_\    "You must find us.... a shrubbery!!!!!!"         |
|____/ /   \____________________________________________________|

louxj@jacobs.CS.ORST.EDU (John W. Loux) (10/10/90)

In article <3464@mindlink.UUCP> a634@mindlink.UUCP (Rob Prior) writes:
>1:     << RCL DUP PURGE >>          (or whatever)
>PRG-> executed would give:
>6:                    <<
>5:                   RCL
>4:                   DUP
>3:                 PURGE
>2:                    >>
>1:                     5            (this all being accomplished
>                                     through the use of sysevals)
>->PRG would take the stack in part 2 and give you what you started with.

Do you mind if I ask what good this is?  Aside from that, something similar
can be accomplished by either creating the program as a LIST or converting the
program to a list and then using OBJ-> to decompose to the stack.  The result
is the same with the exception that the program delimiters are not among the
commands and functions on the stack.  ->LIST will recompose the object and
EVAL will run it as a program.  

``Give it a whirl sometime, Doctor.''

John W. Loux
john@solvint.uucp

bader+@andrew.cmu.edu (Miles Bader) (10/11/90)

louxj@jacobs.CS.ORST.EDU (John W. Loux) writes:
> Do you mind if I ask what good this is?  Aside from that, something similar
> can be accomplished by either creating the program as a LIST or converting
> the program to a list and then using OBJ-> to decompose to the stack.  The
> result is the same with the exception that the program delimiters are not
> among the commands and functions on the stack.  ->LIST will recompose the
> object and EVAL will run it as a program.

The problem with using a list as the program is that it won't automatically
be evaluated when you press the key corresponding to a variable in which it
is stored.  A while ago I wanted to write a little program which would
automagically cons up a program (which simply called another one with a
particular set of args) and store it in a handy variable.  But I couldn't
figure out how to do this...

-Miles