<s>
RPL	B-Device
is	O
a	O
handheld	B-Application
calculator	I-Application
operating	B-General_Concept
system	I-General_Concept
and	O
application	O
programming	O
language	O
used	O
on	O
Hewlett-Packard	O
'	O
s	O
scientific	O
graphing	O
RPN	O
(	O
Reverse	B-Application
Polish	I-Application
Notation	O
)	O
calculators	B-Application
of	O
the	O
HP	B-Device
28	I-Device
,	O
48	B-Device
,	O
49	B-Device
and	O
50	B-Device
series	O
,	O
but	O
it	O
is	O
also	O
usable	O
on	O
non-RPN	O
calculators	B-Application
,	O
such	O
as	O
the	O
38	B-Device
,	O
39	B-Device
and	I-Device
40	I-Device
series	O
.	O
</s>
<s>
RPL	B-Device
is	O
a	O
structured	B-Language
programming	I-Language
language	O
based	O
on	O
RPN	O
,	O
but	O
equally	O
capable	O
of	O
processing	O
algebraic	O
expressions	O
and	O
formulae	O
,	O
implemented	O
as	O
a	O
threaded	B-Application
interpreter	I-Application
.	O
</s>
<s>
RPL	B-Device
has	O
many	O
similarities	O
to	O
Forth	B-Application
,	O
both	O
languages	O
being	O
stack-based	B-Language
,	O
as	O
well	O
as	O
the	O
list-based	O
LISP	B-Language
.	O
</s>
<s>
Contrary	O
to	O
previous	O
HP	O
RPN	O
calculators	B-Application
,	O
which	O
had	O
a	O
fixed	O
four-level	O
stack	B-Language
,	O
the	O
stack	B-Language
used	O
by	O
RPL	B-Device
is	O
only	O
limited	O
by	O
available	O
calculator	B-Application
RAM	B-Architecture
.	O
</s>
<s>
RPL	B-Device
originated	O
from	O
HP	O
's	O
Corvallis	O
,	O
Oregon	O
development	O
facility	O
in	O
1984	O
as	O
a	O
replacement	O
for	O
the	O
previous	O
practice	O
of	O
implementing	O
the	O
operating	B-General_Concept
systems	I-General_Concept
of	O
calculators	B-Application
in	O
assembly	B-Language
language	I-Language
.	O
</s>
<s>
The	O
last	O
pocket	O
calculator	B-Application
supporting	O
RPL	B-Device
,	O
the	O
HP	B-Device
50g	I-Device
,	O
was	O
discontinued	O
in	O
2015	O
.	O
</s>
<s>
However	O
,	O
multiple	O
emulators	O
that	O
can	O
emulate	O
HP	O
's	O
RPL	B-Device
calculators	B-Application
exist	O
that	O
run	O
on	O
a	O
range	O
of	O
operating	B-General_Concept
systems	I-General_Concept
,	O
and	O
devices	O
,	O
including	O
iOS	O
and	O
Android	O
smartphones	O
.	O
</s>
<s>
The	O
internal	O
low	O
-	O
to	O
medium-level	O
variant	O
of	O
RPL	B-Device
,	O
called	O
System	O
RPL	B-Device
(	O
or	O
SysRPL	O
)	O
is	O
used	O
on	O
some	O
earlier	O
HP	O
calculators	B-Application
as	O
well	O
as	O
the	O
aforementioned	O
ones	O
,	O
as	O
part	O
of	O
their	O
operating	B-General_Concept
system	I-General_Concept
implementation	O
language	O
.	O
</s>
<s>
In	O
the	O
HP48	B-Device
series	O
this	O
variant	O
of	O
RPL	B-Device
is	O
not	O
accessible	O
to	O
the	O
calculator	B-Application
user	O
without	O
the	O
use	O
of	O
external	O
tools	O
,	O
but	O
in	O
the	O
HP49/50	O
series	O
there	O
is	O
a	O
compiler	O
built	O
into	O
ROM	O
to	O
use	O
SysRPL	O
.	O
</s>
<s>
The	O
high-level	O
User	O
RPL	B-Device
(	O
or	O
UserRPL	O
)	O
version	O
of	O
the	O
language	O
is	O
available	O
on	O
said	O
graphing	O
calculators	B-Application
for	O
developing	O
textual	O
as	O
well	O
as	O
graphical	O
application	O
programs	O
.	O
</s>
<s>
The	O
UserRPL	O
command	O
SYSEVAL	O
tells	O
the	O
calculator	B-Application
to	O
process	O
designated	O
parts	O
of	O
a	O
UserRPL	O
program	O
as	O
SysRPL	O
code	O
.	O
</s>
<s>
RPL	B-Device
control	O
blocks	O
are	O
not	O
strictly	O
postfix	O
.	O
</s>
<s>
The	O
calculator	B-Application
manages	O
this	O
by	O
allowing	O
the	O
implementation	O
of	O
these	O
blocks	O
to	O
skip	O
ahead	O
in	O
the	O
program	O
stream	O
as	O
necessary	O
.	O
</s>
<s>
RPL	B-Device
supports	O
basic	O
conditional	O
testing	O
through	O
the	O
IF/THEN/ELSE	O
structure	O
.	O
</s>
<s>
The	O
following	O
example	O
tests	O
to	O
see	O
if	O
the	O
number	O
at	O
the	O
bottom	O
of	O
the	O
stack	B-Language
is	O
"	O
1	O
"	O
and	O
,	O
if	O
so	O
,	O
replaces	O
it	O
with	O
"	O
Equal	O
to	O
one	O
"	O
:	O
</s>
<s>
The	O
IF	O
construct	O
evaluates	O
the	O
condition	O
then	O
tests	O
the	O
bottom	O
of	O
the	O
stack	B-Language
for	O
the	O
result	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
RPL	B-Device
can	O
optionally	O
support	O
FORTH-style	O
IF	O
blocks	O
,	O
allowing	O
the	O
condition	O
to	O
be	O
determined	O
before	O
the	O
block	O
.	O
</s>
<s>
By	O
leaving	O
the	O
condition	O
empty	O
,	O
the	O
IF	O
statement	O
will	O
not	O
make	O
any	O
changes	O
to	O
the	O
stack	B-Language
during	O
the	O
condition	O
execution	O
and	O
will	O
use	O
the	O
existing	O
result	O
at	O
the	O
bottom	O
of	O
the	O
stack	B-Language
for	O
the	O
test	O
:	O
</s>
<s>
IFT	O
and	O
IFTE	O
pop	O
two	O
or	O
three	O
commands	O
off	O
the	O
stack	B-Language
,	O
respectively	O
.	O
</s>
<s>
The	O
topmost	O
value	O
is	O
evaluated	O
as	O
a	O
boolean	O
and	O
,	O
if	O
true	O
,	O
the	O
second	O
topmost	O
value	O
is	O
pushed	O
back	O
on	O
the	O
stack	B-Language
.	O
</s>
<s>
IFTE	O
allows	O
a	O
third	O
"	O
else	O
"	O
value	O
that	O
will	O
be	O
pushed	O
back	O
on	O
the	O
stack	B-Language
if	O
the	O
boolean	O
is	O
false	O
.	O
</s>
<s>
The	O
following	O
example	O
uses	O
the	O
IFT	O
function	O
to	O
pop	O
an	O
object	O
from	O
the	O
bottom	O
of	O
the	O
stack	B-Language
and	O
,	O
if	O
it	O
is	O
equal	O
to	O
1	O
,	O
replaces	O
it	O
with	O
"	O
One	O
"	O
:	O
</s>
<s>
The	O
following	O
example	O
uses	O
the	O
IFTE	O
function	O
to	O
pop	O
an	O
object	O
from	O
the	O
bottom	O
of	O
the	O
stack	B-Language
and	O
,	O
if	O
it	O
is	O
equal	O
to	O
1	O
,	O
replaces	O
it	O
with	O
"	O
One	O
"	O
.	O
</s>
<s>
The	O
following	O
example	O
pops	O
an	O
object	O
from	O
the	O
bottom	O
of	O
the	O
stack	B-Language
,	O
and	O
replaces	O
it	O
with	O
"	O
One	O
"	O
,	O
"	O
Less	O
"	O
,	O
or	O
"	O
More	O
"	O
,	O
depending	O
on	O
whether	O
it	O
is	O
equal	O
to	O
,	O
less	O
than	O
,	O
or	O
greater	O
than	O
1	O
.	O
</s>
<s>
To	O
support	O
more	O
complex	O
conditional	O
logic	O
,	O
RPL	B-Device
provides	O
the	O
CASE/THEN/END	O
structure	O
for	O
handling	O
multiple	O
exclusive	O
tests	O
.	O
</s>
<s>
Given	O
a	O
letter	O
at	O
the	O
bottom	O
of	O
the	O
stack	B-Language
,	O
it	O
replaces	O
it	O
with	O
its	O
string	O
equivalent	O
or	O
"	O
Unknown	O
letter	O
"	O
:	O
</s>
<s>
RPL	B-Device
provides	O
a	O
FOR/NEXT	O
statement	O
for	O
looping	O
from	O
one	O
index	O
to	O
another	O
.	O
</s>
<s>
The	O
WHILE/REPEAT/END	O
block	O
in	O
RPL	B-Device
supports	O
an	O
indefinite	O
loop	O
with	O
the	O
condition	O
test	O
at	O
the	O
start	O
of	O
the	O
loop	O
.	O
</s>
<s>
The	O
DO/UNTIL/END	O
block	O
in	O
RPL	B-Device
supports	O
an	O
indefinite	O
loop	O
with	O
the	O
condition	O
test	O
at	O
the	O
end	O
of	O
the	O
loop	O
.	O
</s>
