<s>
FOCAL	B-Language
(	O
acronym	O
for	O
Formulating	B-Language
On-line	I-Language
Calculations	I-Language
in	I-Language
Algebraic	I-Language
Language	I-Language
,	O
or	O
FOrmula	O
CALculator	O
)	O
is	O
an	O
interactive	O
interpreted	B-Application
programming	I-Application
language	I-Application
based	O
on	O
JOSS	B-Language
and	O
mostly	O
used	O
on	O
Digital	O
Equipment	O
Corporation	O
(	O
DEC	O
)	O
Programmed	B-Device
Data	I-Device
Processor	I-Device
(	O
PDP	O
)	O
series	O
machines	O
.	O
</s>
<s>
FOCAL	B-Language
is	O
very	O
similar	O
to	O
JOSS	B-Language
in	O
the	O
commands	O
it	O
supports	O
and	O
the	O
general	O
syntax	O
of	O
the	O
language	O
.	O
</s>
<s>
It	O
differs	O
in	O
that	O
many	O
of	O
JOSS	B-Language
 '	O
advanced	O
features	O
like	O
ranges	B-Data_Structure
and	O
user-defined	B-Language
functions	I-Language
were	O
removed	O
to	O
simplify	O
the	O
parser	B-Language
.	O
</s>
<s>
This	O
was	O
an	O
important	O
consideration	O
on	O
the	O
PDP-8	B-Device
,	O
which	O
was	O
often	O
limited	O
to	O
a	O
few	O
kilobytes	O
(	O
KB	O
)	O
.	O
</s>
<s>
Like	O
JOSS	B-Language
,	O
and	O
later	O
BASICs	O
,	O
FOCAL	B-Language
on	O
the	O
PDP-8	B-Device
was	O
a	O
complete	O
environment	O
that	O
included	O
a	O
line	B-Application
editor	I-Application
,	O
an	O
interpreter	B-Application
,	O
and	O
input/output	B-General_Concept
routines	O
.	O
</s>
<s>
The	O
package	O
as	O
a	O
whole	O
was	O
named	O
FOCAL-8	O
,	O
which	O
also	O
ran	O
on	O
the	O
PDP-5	B-Device
and	O
PDP-12	B-Device
.	O
</s>
<s>
When	O
ported	O
to	O
the	O
PDP-11	B-Device
,	O
the	O
resulting	O
FOCAL-11	O
relied	O
on	O
the	O
underlying	O
operating	B-General_Concept
system	I-General_Concept
,	O
RT-11	B-Operating_System
,	O
to	O
provide	O
file	O
support	O
and	O
editing	O
.	O
</s>
<s>
The	O
language	O
definition	O
was	O
updated	O
twice	O
,	O
to	O
FOCAL-69	B-Language
and	O
a	O
very	O
slightly	O
modified	O
FOCAL-71	O
.	O
</s>
<s>
A	O
port	O
to	O
the	O
Intel	B-General_Concept
8080	I-General_Concept
was	O
also	O
available	O
.	O
</s>
<s>
FOCAL	B-Language
is	O
notable	O
as	O
the	O
language	O
in	O
which	O
the	O
original	O
versions	O
of	O
the	O
early	O
video	O
games	O
Hamurabi	B-Application
and	O
Lunar	B-Application
Lander	I-Application
were	O
written	O
.	O
</s>
<s>
FOCAL	B-Language
was	O
not	O
popular	O
outside	O
the	O
PDP	O
platform	O
and	O
largely	O
disappeared	O
during	O
the	O
move	O
to	O
the	O
VAX-11	O
.	O
</s>
<s>
It	O
had	O
a	O
strong	O
revival	O
in	O
the	O
Soviet	O
Union	O
where	O
PDP-11	B-Device
clones	O
were	O
used	O
as	O
educational	O
and	O
home	O
computers	O
(	O
BK	B-Device
series	I-Device
)	O
.	O
</s>
<s>
JOSS	B-Language
was	O
released	O
in	O
May	O
1963	O
on	O
the	O
one-off	O
JOHNNIAC	B-Device
computer	O
at	O
RAND	O
Corporation	O
.	O
</s>
<s>
JOHNNIAC	B-Device
was	O
decommissioned	O
in	O
1966	O
and	O
JOSS	B-Language
was	O
reimplemented	O
on	O
a	O
newly	O
purchased	O
PDP-6	B-Device
,	O
Digital	O
Equipment	O
Corporation	O
's	O
(	O
DEC	O
)	O
first	O
"	O
big	O
"	O
machine	O
.	O
</s>
<s>
Use	O
continued	O
to	O
grow	O
and	O
by	O
1970	O
,	O
the	O
system	O
was	O
being	O
used	O
by	O
500	O
to	O
600	O
users	O
across	O
the	O
country	O
and	O
had	O
spawned	O
several	O
innovations	O
such	O
as	O
mobile	O
computer	B-General_Concept
terminals	I-General_Concept
that	O
could	O
be	O
wheeled	O
from	O
room	O
to	O
room	O
and	O
plugged	O
in	O
for	O
quick	O
access	O
.	O
</s>
<s>
JOSS	B-Language
was	O
highly	O
influential	O
.	O
</s>
<s>
It	O
emerged	O
just	O
as	O
time-sharing	B-General_Concept
was	O
being	O
introduced	O
.	O
</s>
<s>
Whereas	O
most	O
time-sharing	B-General_Concept
operating	I-General_Concept
systems	I-General_Concept
of	O
the	O
era	O
concentrated	O
on	O
user	O
account	O
and	O
file	O
management	O
,	O
leaving	O
the	O
users	O
to	O
do	O
their	O
own	O
programming	O
,	O
JOSS	B-Language
provided	O
file	O
editing	O
and	O
a	O
programming	O
language	O
in	O
one	O
package	O
.	O
</s>
<s>
The	O
PDP-6	B-Device
was	O
DEC	O
's	O
first	O
mainframe	B-Architecture
,	O
and	O
JOSS	B-Language
took	O
full	O
advantage	O
of	O
its	O
power	O
and	O
memory	O
capacity	O
.	O
</s>
<s>
DEC	O
programmers	O
were	O
interested	O
in	O
JOSS	B-Language
,	O
but	O
most	O
of	O
their	O
machines	O
had	O
nowhere	O
near	O
the	O
power	O
needed	O
to	O
run	O
it	O
.	O
</s>
<s>
Written	O
by	O
Richard	O
Merrill	O
,	O
FOCAL	B-Language
removed	O
features	O
from	O
JOSS	B-Language
as	O
required	O
in	O
order	O
to	O
be	O
able	O
to	O
run	O
in	O
the	O
much	O
more	O
limited	O
memory	O
space	O
of	O
the	O
PDP-8	B-Device
and	O
other	O
12-bit	B-Device
machines	O
in	O
the	O
DEC	O
lineup	O
.	O
</s>
<s>
To	O
achieve	O
this	O
,	O
a	O
major	O
change	O
was	O
made	O
to	O
reduce	O
the	O
amount	O
of	O
temporary	O
data	O
,	O
or	O
state	B-Application
,	O
needed	O
to	O
parse	B-Language
the	O
statements	O
.	O
</s>
<s>
One	O
noticeable	O
effect	O
of	O
this	O
decision	O
was	O
that	O
conditionals	B-Language
could	O
only	O
be	O
used	O
for	O
branches	B-General_Concept
,	O
in	O
contrast	O
to	O
JOSS	B-Language
,	O
where	O
conditionals	B-Language
can	O
be	O
applied	O
to	O
any	O
statement	O
.	O
</s>
<s>
This	O
simplified	O
the	O
parser	B-Language
,	O
which	O
needed	O
to	O
read	O
only	O
the	O
first	O
letter	O
of	O
the	O
command	O
on	O
a	O
line	O
of	O
code	O
,	O
and	O
could	O
then	O
skip	O
forward	O
to	O
the	O
next	O
whitespace	O
character	O
.	O
</s>
<s>
In	O
contrast	O
,	O
JOSS	B-Language
had	O
to	O
continue	O
reading	O
until	O
it	O
had	O
read	O
the	O
entire	O
command	O
word	O
and	O
then	O
compared	O
that	O
against	O
a	O
list	O
containing	O
complete	O
words	O
.	O
</s>
<s>
Not	O
only	O
did	O
this	O
change	O
save	O
memory	O
in	O
the	O
parser	B-Language
,	O
users	O
could	O
also	O
save	O
memory	O
by	O
typing	O
in	O
only	O
that	O
letter	O
,	O
reducing	O
the	O
size	O
of	O
the	O
source	O
code	O
.	O
</s>
<s>
The	O
first	O
version	O
of	O
FOCAL	B-Language
was	O
released	O
in	O
1968	O
for	O
the	O
PDP-8	B-Device
.	O
</s>
<s>
An	O
updated	O
version	O
followed	O
the	O
next	O
year	O
,	O
which	O
was	O
later	O
known	O
as	O
FOCAL-69	B-Language
.	O
</s>
<s>
The	O
system	O
as	O
a	O
whole	O
,	O
regardless	O
of	O
version	O
,	O
was	O
known	O
as	O
FOCAL-8	O
when	O
it	O
was	O
ported	O
to	O
other	O
machines	O
in	O
the	O
12-bit	B-Device
series	O
,	O
including	O
the	O
PDP-5	B-Device
and	O
PDP-12	B-Device
.	O
</s>
<s>
The	O
similar	O
FOCAL-11	O
ran	O
on	O
the	O
PDP-11	B-Device
under	O
RT-11	B-Operating_System
.	O
</s>
<s>
Processor	O
Technology	O
also	O
offered	O
a	O
version	O
of	O
8k	O
FOCAL	B-Language
,	O
complete	O
with	O
Lunar	B-Application
Lander	I-Application
,	O
for	O
the	O
Intel	O
8080-based	O
Altair	B-Architecture
8800	I-Architecture
system	O
.	O
</s>
<s>
While	O
FOCAL	B-Language
was	O
becoming	O
popular	O
on	O
DEC	O
machines	O
,	O
BASIC	O
was	O
becoming	O
a	O
more	O
popular	O
alternative	O
on	O
other	O
platforms	O
.	O
</s>
<s>
By	O
the	O
late	O
1960s	O
,	O
several	O
companies	O
were	O
making	O
inroads	O
in	O
DEC	O
's	O
minicomputer	B-Architecture
stronghold	O
,	O
selling	O
similar	O
machines	O
running	O
time-sharing	B-General_Concept
versions	O
of	O
BASIC	O
.	O
</s>
<s>
Notable	O
among	O
these	O
was	O
the	O
HP	B-Device
2100	I-Device
series	O
,	O
running	O
HP	B-Language
Time-Shared	I-Language
BASIC	I-Language
.	O
</s>
<s>
David	O
H	O
.	O
Ahl	O
had	O
recently	O
joined	O
DEC	O
's	O
PDP-8	B-Device
Group	O
,	O
just	O
as	O
the	O
company	O
became	O
interested	O
in	O
selling	O
the	O
machine	O
into	O
educational	O
settings	O
.	O
</s>
<s>
Due	O
to	O
the	O
popularity	O
of	O
BASIC	O
in	O
the	O
education	O
market	O
,	O
especially	O
with	O
the	O
growing	O
library	O
of	O
BASIC	O
programs	O
from	O
the	O
Minnesota	O
Educational	O
Computing	O
Consortium	O
,	O
Ahl	O
found	O
selling	O
the	O
machine	O
with	O
FOCAL	B-Language
was	O
difficult	O
despite	O
its	O
advantages	O
.	O
</s>
<s>
Ahl	O
took	O
it	O
upon	O
himself	O
to	O
produce	O
a	O
BASIC	O
system	O
for	O
the	O
platform	O
,	O
hiring	O
a	O
company	O
he	O
later	O
learned	O
was	O
a	O
single	O
programmer	O
in	O
Brooklyn	O
to	O
produce	O
a	O
version	O
for	O
the	O
4kWord	O
PDP-8	B-Device
.	O
</s>
<s>
DEC	O
began	O
selling	O
packaged	O
versions	O
of	O
the	O
PDP-8	B-Device
with	O
terminals	O
and	O
the	O
BASIC	O
as	O
the	O
"	O
EduSystem	O
"	O
lineup	O
,	O
with	O
larger	O
systems	O
in	O
the	O
series	O
having	O
expanded	O
versions	O
of	O
BASIC	O
,	O
and	O
in	O
some	O
cases	O
,	O
also	O
FOCAL	B-Language
and	O
FORTRAN	B-Application
.	O
</s>
<s>
Some	O
PDP-11	B-Device
based	O
EduSystems	O
were	O
also	O
created	O
.	O
</s>
<s>
Ahl	O
then	O
began	O
porting	O
programs	O
from	O
FOCAL	B-Language
to	O
BASIC	O
,	O
notably	O
The	B-Application
Sumer	I-Application
Game	I-Application
(	O
which	O
he	O
renamed	O
Hamurabi	B-Application
)	O
,	O
a	O
version	O
of	O
Lunar	B-Application
Lander	I-Application
,	O
and	O
many	O
smaller	O
FOCAL	B-Language
demos	O
.	O
</s>
<s>
By	O
the	O
mid-1970s	O
BASIC	O
was	O
a	O
standard	O
feature	O
of	O
all	O
DEC	O
machines	O
and	O
FOCAL	B-Language
use	O
evaporated	O
.	O
</s>
<s>
The	O
PDP-11	B-Device
had	O
been	O
cloned	O
in	O
the	O
Soviet	O
Union	O
in	O
the	O
1970s	O
for	O
military	O
purposes	O
.	O
</s>
<s>
In	O
the	O
1980s	O
,	O
single-chip	O
variations	O
similar	O
to	O
the	O
LSI-11	O
were	O
produced	O
that	O
gave	O
rise	O
to	O
a	O
series	O
of	O
PDP-11	B-Device
compatible	O
home	O
computers	O
.	O
</s>
<s>
Most	O
notable	O
among	O
several	O
models	O
were	O
the	O
Electronika	B-Device
BK	I-Device
series	O
,	O
released	O
in	O
1985	O
.	O
</s>
<s>
These	O
were	O
initially	O
supplied	O
with	O
FOCAL	B-Language
on	O
a	O
ROM	B-Protocol
cartridge	I-Protocol
,	O
while	O
a	O
BASIC	O
cartridge	B-Protocol
was	O
an	O
optional	O
add-on	O
.	O
</s>
<s>
The	O
following	O
description	O
is	O
based	O
on	O
FOCAL-69	B-Language
as	O
seen	O
in	O
the	O
FOCAL-8	O
language	O
reference	O
manual	O
.	O
</s>
<s>
FOCAL	B-Language
followed	O
the	O
JOSS	B-Language
model	O
for	O
interaction	O
via	O
a	O
command	B-Application
line	I-Application
interface	I-Application
.	O
</s>
<s>
It	O
contrasts	O
with	O
JOSS	B-Language
,	O
in	O
which	O
all	O
commands	O
,	O
both	O
program	O
and	O
direct	O
,	O
were	O
saved	O
and	O
loaded	O
as	O
part	O
of	O
the	O
user	O
's	O
workspace	O
.	O
</s>
<s>
This	O
allowed	O
JOSS	B-Language
to	O
have	O
commands	O
without	O
line	O
numbers	O
,	O
which	O
they	O
used	O
for	O
definitions	O
and	O
other	O
tasks	O
.	O
</s>
<s>
FOCAL	B-Language
lacked	O
this	O
capability	O
,	O
so	O
those	O
instructions	O
that	O
needed	O
to	O
be	O
loaded	O
and	O
saved	O
became	O
options	O
on	O
other	O
program-mode	O
commands	O
like	O
.	O
</s>
<s>
Every	O
line	O
in	O
a	O
FOCAL	B-Language
program	O
must	O
start	O
with	O
a	O
line	O
number	O
.	O
</s>
<s>
As	O
with	O
JOSS	B-Language
,	O
line	O
numbers	O
are	O
fixed-point	O
numbers	O
consisting	O
of	O
two	O
two-digit	O
integers	O
separated	O
by	O
a	O
period	O
.	O
</s>
<s>
In	O
FOCAL-8	O
,	O
valid	O
line	O
numbers	O
range	O
from	O
1.01	O
through	O
31.99	O
.	O
</s>
<s>
When	O
printed	O
out	O
,	O
using	O
,	O
the	O
FOCAL	B-Language
equivalent	O
to	O
BASIC	O
's	O
,	O
leading	O
zeros	O
will	O
be	O
added	O
;	O
1.10	O
will	O
be	O
printed	O
as	O
.	O
</s>
<s>
Groups	O
provide	O
some	O
level	O
of	O
code	O
organization	O
that	O
is	O
lacking	O
in	O
languages	O
like	O
Fortran	B-Application
or	O
BASIC	O
.	O
</s>
<s>
Usually	O
,	O
the	O
behavior	O
is	O
no	O
different	O
than	O
if	O
the	O
statements	O
had	O
been	O
on	O
separate	O
lines	O
,	O
except	O
in	O
the	O
case	O
of	O
FOR	B-Language
loops	I-Language
.	O
</s>
<s>
The	O
command	O
(	O
abbreviation	O
A	O
)	O
will	O
take	O
a	O
list	O
of	O
strings	O
and	O
variables	O
,	O
echo	O
the	O
strings	O
and	O
store	O
the	O
user	B-General_Concept
input	I-General_Concept
in	O
variables	O
.	O
</s>
<s>
The	O
command	O
(	O
abbreviation	O
D	O
)	O
branches	B-General_Concept
execution	O
to	O
a	O
subroutine	O
.	O
</s>
<s>
The	O
command	O
(	O
abbreviation	O
F	O
)	O
implements	O
a	O
for	B-Language
loop	I-Language
.	O
</s>
<s>
This	O
is	O
the	O
pattern	O
from	O
FORTRAN	B-Application
's	O
loops	O
,	O
as	O
opposed	O
to	O
BASIC	O
's	O
where	O
the	O
increment	O
is	O
the	O
last	O
value	O
,	O
if	O
present	O
.	O
</s>
<s>
A	O
sample	O
FOR	B-Language
loop	I-Language
:	O
</s>
<s>
In	O
FOCAL	B-Language
,	O
is	O
also	O
used	O
to	O
begin	O
execution	O
,	O
like	O
BASIC	O
's	O
,	O
but	O
in	O
this	O
use	O
,	O
the	O
documentation	O
refers	O
to	O
it	O
as	O
instead	O
of	O
in	O
spite	O
of	O
the	O
underlying	O
command	O
being	O
the	O
same	O
.	O
</s>
<s>
The	O
command	O
(	O
abbreviation	O
I	O
)	O
provides	O
a	O
conditional	B-General_Concept
branch	I-General_Concept
based	O
on	O
the	O
sign	O
of	O
the	O
expression	O
.	O
</s>
<s>
After	O
the	O
numeric	B-Algorithm
expression	O
,	O
the	O
IF	O
command	O
can	O
take	O
one	O
to	O
three	O
line	O
numbers	O
.	O
</s>
<s>
If	O
the	O
expression	O
is	O
less	O
than	O
zero	O
,	O
execution	O
branches	B-General_Concept
to	O
the	O
first	O
line	O
number	O
;	O
if	O
equal	O
to	O
zero	O
,	O
to	O
the	O
second	O
line	O
number	O
;	O
if	O
greater	O
than	O
zero	O
,	O
to	O
the	O
third	O
line	O
number	O
.	O
</s>
<s>
The	O
command	O
(	O
abbreviation	O
R	O
)	O
branches	B-General_Concept
execution	O
from	O
a	O
subroutine	O
back	O
to	O
the	O
calling	O
location	O
.	O
</s>
<s>
Using	O
%	O
alone	O
caused	O
the	O
output	O
to	O
be	O
printed	O
in	O
"	O
floating	B-Algorithm
point	I-Algorithm
format	I-Algorithm
"	O
using	O
the	O
E	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
code	O
sample	O
from	O
FOCAL	B-Language
:	O
A	O
New	O
Conversational	O
Language	O
refers	O
to	O
the	O
same	O
variable	O
as	O
DESTINATION	O
and	O
then	O
DES	O
.	O
</s>
<s>
FOCAL-69	B-Language
contained	O
five	O
mathematical	O
operators	O
:	O
</s>
<s>
One	O
curiosity	O
of	O
FOCAL	B-Language
was	O
that	O
the	O
operators	O
all	O
had	O
independent	O
precedence	O
,	O
as	O
in	O
the	O
order	O
above	O
.	O
</s>
<s>
This	O
can	O
cause	O
subtle	O
errors	O
when	O
converting	O
FOCAL	B-Language
source	O
code	O
to	O
other	O
systems	O
.	O
</s>
<s>
FOCAL	B-Language
was	O
unusual	O
in	O
that	O
mathematical	O
expressions	O
could	O
use	O
(	O
)	O
,	O
[],	O
and	O
<>	O
interchangeably	O
in	O
matched	O
pairs	O
to	O
establish	O
precedence	O
.	O
</s>
<s>
FOCAL	B-Language
also	O
included	O
several	O
special-purpose	O
functions	O
:	O
</s>
<s>
FOCAL	B-Language
used	O
in	O
the	O
editor	O
to	O
start	O
a	O
program	O
.	O
</s>
<s>
The	O
editing	O
commands	O
were	O
ERASE	O
(	O
abbreviation	O
E	O
)	O
,	O
MODIFY	O
(	O
abbreviation	O
M	B-Language
)	O
,	O
and	O
WRITE	O
(	O
abbreviation	O
W	O
)	O
:	O
</s>
<s>
FOCAL	B-Language
included	O
the	O
ability	O
to	O
manage	O
collections	O
of	O
FOCAL	B-Language
programs	O
as	O
a	O
code	O
library	O
.	O
</s>
<s>
FOCAL-71	O
added	O
:	O
</s>
<s>
Since	O
the	O
interpreter	B-Application
lacked	O
sufficient	O
memory	O
space	O
to	O
store	O
error	O
messages	O
,	O
or	O
even	O
a	O
table	O
of	O
error	O
numbers	O
,	O
FOCAL	B-Language
used	O
a	O
workaround	O
by	O
reporting	O
the	O
address	O
of	O
the	O
error-detecting	O
code	O
as	O
a	O
fixed-point	O
number	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
division	B-Algorithm
by	I-Algorithm
zero	I-Algorithm
error	I-Algorithm
was	O
detected	O
it	O
would	O
report	O
,	O
where	O
28.73	O
represents	O
the	O
code	O
checking	O
for	O
this	O
error	O
at	O
memory	O
page	O
28	O
plus	O
an	O
offset	O
of	O
73	O
words	O
,	O
and	O
01.10	O
is	O
the	O
line	O
number	O
where	O
the	O
error	O
occurred	O
.	O
</s>
<s>
Pages	O
in	O
the	O
PDP-8	B-Device
were	O
128	O
bytes	O
long	O
,	O
so	O
this	O
address	O
translates	O
to	O
location	O
3657	O
.	O
</s>
<s>
DEC	O
released	O
three	O
versions	O
of	O
FOCAL	B-Language
for	O
the	O
PDP-8	B-Device
series	O
,	O
the	O
original	O
,	O
known	O
simply	O
as	O
FOCAL	B-Language
,	O
and	O
two	O
updated	O
versions	O
,	O
</s>
<s>
FOCAL	B-Language
,	O
1969	O
and	O
FOCAL	B-Language
,	O
1971	O
.	O
</s>
<s>
FOCAL	B-Language
,	O
1969	O
was	O
largely	O
identical	O
to	O
the	O
original	O
,	O
but	O
FOCAL	B-Language
,	O
1971	O
was	O
major	O
update	O
that	O
added	O
file	O
handling	O
,	O
new	O
mathematics	O
,	O
and	O
a	O
variety	O
of	O
other	O
changes	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
first	O
two	O
versions	O
,	O
which	O
were	O
stand-alone	O
systems	O
,	O
FOCAL	B-Language
,	O
1971	O
was	O
based	O
on	O
the	O
emerging	O
OS/8	B-Operating_System
(	O
then	O
still	O
known	O
as	O
PS/8	O
)	O
and	O
relied	O
more	O
heavily	O
on	O
that	O
operating	B-General_Concept
system	I-General_Concept
for	O
file	O
handling	O
and	O
editing	O
.	O
</s>
<s>
It	O
also	O
added	O
the	O
new	O
function	O
that	O
took	O
a	O
string	O
and	O
returned	O
its	O
ASCII	B-Protocol
value	I-Protocol
(	O
akin	O
to	O
BASIC	O
's	O
)	O
and	O
which	O
took	O
a	O
number	O
and	O
returned	O
a	O
string	O
with	O
that	O
ASCII	B-Protocol
character	I-Protocol
(	O
)	O
.	O
</s>
<s>
As	O
all	O
of	O
these	O
options	O
used	O
up	O
limited	O
memory	O
,	O
when	O
started	O
,	O
FOCAL	B-Language
,	O
1971	O
entered	O
a	O
dialog	O
that	O
asked	O
the	O
user	O
what	O
features	O
they	O
wanted	O
to	O
use	O
.	O
</s>
<s>
FOCAL	B-Language
is	O
,	O
for	O
all	O
intents	O
,	O
a	O
cleaned-up	O
version	O
of	O
JOSS	B-Language
with	O
changes	O
to	O
make	O
the	O
syntax	O
terser	O
and	O
easier	O
to	O
parse	B-Language
.	O
</s>
<s>
Almost	O
all	O
FOCAL	B-Language
commands	O
have	O
a	O
one-to-one	O
correspondence	O
with	O
JOSS	B-Language
and	O
differ	O
only	O
in	O
details	O
.	O
</s>
<s>
The	O
most	O
obvious	O
change	O
at	O
first	O
glance	O
is	O
that	O
JOSS	B-Language
is	O
case-insensitive	O
and	O
outputs	O
keywords	O
in	O
mixed-case	O
whereas	O
FOCAL	B-Language
was	O
upper-case	O
only	O
.	O
</s>
<s>
Additionally	O
,	O
JOSS	B-Language
statements	O
end	O
with	O
a	O
period	O
,	O
making	O
them	O
look	O
like	O
written	O
statements	O
,	O
whereas	O
FOCAL	B-Language
has	O
no	O
required	O
line-ending	O
.	O
</s>
<s>
One	O
major	O
difference	O
is	O
that	O
JOSS	B-Language
included	O
a	O
complete	O
set	O
of	O
comparison	O
operations	O
and	O
a	O
boolean	O
logic	O
system	O
that	O
operated	O
within	O
and	O
constructs	O
.	O
</s>
<s>
Furthermore	O
,	O
branches	B-General_Concept
and	O
loops	O
could	O
be	O
applied	O
to	O
any	O
statement	O
,	O
in	O
contrast	O
to	O
FOCAL	B-Language
,	O
where	O
the	O
only	O
operation	O
either	O
could	O
carry	O
out	O
was	O
the	O
equivalent	O
to	O
a	O
goto	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
JOSS	B-Language
,	O
one	O
could	O
:	O
</s>
<s>
In	O
contrast	O
,	O
FOCAL	B-Language
lacked	O
the	O
ability	O
to	O
compare	O
values	O
,	O
and	O
loops	O
were	O
applied	O
by	O
skipping	O
to	O
the	O
next	O
line	O
when	O
they	O
completed	O
.	O
</s>
<s>
The	O
equivalent	O
code	O
in	O
FOCAL	B-Language
would	O
be	O
:	O
</s>
<s>
JOSS	B-Language
 '	O
implementation	O
makes	O
common	O
constructs	O
easier	O
to	O
build	O
and	O
more	O
closely	O
match	O
a	O
programmer	O
's	O
intentions	O
,	O
at	O
the	O
cost	O
of	O
making	O
the	O
runtime	O
more	O
complex	O
.	O
</s>
<s>
For	O
example	O
,	O
JOSS	B-Language
allowed	O
ranges	B-Data_Structure
in	O
loops	O
to	O
be	O
described	O
in	O
a	O
flexible	O
fashion	O
like	O
1	O
,	O
2	O
,	O
3	O
,	O
10(5 )	O
50	O
,	O
75	O
,	O
78	O
.	O
</s>
<s>
This	O
flexibility	O
comes	O
at	O
a	O
cost	O
;	O
in	O
FOCAL	B-Language
the	O
start	O
,	O
stop	O
,	O
and	O
step	O
can	O
be	O
written	O
in	O
a	O
custom	O
in-memory	O
structure	O
and	O
easily	O
updated	O
as	O
the	O
loop	O
is	O
performed	O
,	O
whereas	O
JOSS	B-Language
requires	O
it	O
to	O
reevaluate	O
an	O
expression	O
that	O
may	O
be	O
,	O
but	O
often	O
is	O
n't	O
,	O
more	O
complex	O
.	O
</s>
<s>
In	O
order	O
to	O
make	O
the	O
code	O
terser	O
in	O
FOCAL	B-Language
,	O
changes	O
were	O
relatively	O
minor	O
.	O
</s>
<s>
For	O
example	O
,	O
JOSS	B-Language
 '	O
becomes	O
the	O
slightly	O
smaller	O
FOCAL	B-Language
,	O
while	O
becomes	O
.	O
</s>
<s>
Command	O
keywords	O
were	O
also	O
shortened	O
where	O
possible	O
,	O
so	O
JOSS	B-Language
 '	O
becomes	O
FOCAL	B-Language
's	O
,	O
both	O
to	O
make	O
it	O
shorter	O
and	O
to	O
allow	O
the	O
letter	O
D	O
to	O
be	O
uniquely	O
used	O
for	O
.	O
</s>
<s>
To	O
simplify	O
the	O
parser	B-Language
,	O
some	O
FOCAL	B-Language
options	O
were	O
removed	O
.	O
</s>
<s>
For	O
example	O
,	O
JOSS	B-Language
could	O
perform	O
multiple	O
assignments	O
with	O
while	O
in	O
FOCAL	B-Language
these	O
had	O
to	O
be	O
made	O
individual	O
statements	O
,	O
.	O
</s>
<s>
Likewise	O
,	O
JOSS	B-Language
 '	O
,	O
used	O
to	O
format	O
output	O
,	O
was	O
combined	O
into	O
FOCAL	B-Language
's	O
with	O
the	O
.	O
</s>
<s>
Comparisons	O
between	O
FOCAL	B-Language
and	O
BASIC	O
were	O
inevitable	O
since	O
both	O
languages	O
were	O
common	O
on	O
minicomputers	B-Architecture
of	O
the	O
same	O
era	O
,	O
and	O
the	O
two	O
languages	O
have	O
much	O
in	O
common	O
in	O
syntax	O
and	O
structure	O
.	O
</s>
<s>
In	O
most	O
cases	O
,	O
there	O
is	O
a	O
direct	O
conversion	O
of	O
FOCAL	B-Language
code	O
to	O
and	O
from	O
BASIC	O
.	O
</s>
<s>
For	O
example	O
,	O
to	O
ask	O
a	O
user	O
to	O
input	O
a	O
value	O
,	O
in	O
FOCAL	B-Language
one	O
would	O
:	O
</s>
<s>
One	O
notable	O
exception	O
is	O
the	O
in	O
BASIC	O
,	O
which	O
allowed	O
any	O
statement	O
to	O
be	O
placed	O
after	O
the	O
,	O
making	O
it	O
more	O
similar	O
with	O
JOSS	B-Language
 '	O
control	O
structures	O
.	O
</s>
<s>
BASIC	O
reversed	O
the	O
ordering	O
of	O
the	O
code	O
compared	O
to	O
JOSS	B-Language
,	O
placing	O
the	O
conditional	B-Language
expression	O
at	O
the	O
start	O
of	O
the	O
line	O
rather	O
than	O
the	O
end	O
;	O
in	O
BASIC	O
one	O
uses	O
whereas	O
FOCAL	B-Language
used	O
,	O
as	O
in	O
JOSS	B-Language
.	O
</s>
<s>
In	O
contrast	O
,	O
FOCAL	B-Language
's	O
was	O
more	O
like	O
BASIC	O
's	O
computed	O
goto	O
,	O
,	O
but	O
the	O
allowed	O
any	O
number	O
of	O
lines	O
as	O
targets	O
,	O
as	O
opposed	O
to	O
only	O
three	O
for	O
negative	O
,	O
zero	O
and	O
positive	O
as	O
in	O
JOSS	B-Language
and	O
FOCAL	B-Language
.	O
</s>
<s>
Another	O
major	O
difference	O
between	O
the	O
two	O
is	O
that	O
FOCAL	B-Language
lacked	O
inherent	O
support	O
for	O
strings	O
as	O
data	O
elements	O
that	O
could	O
be	O
assigned	O
to	O
variables	O
.	O
</s>
<s>
As	O
was	O
the	O
case	O
in	O
early	O
BASICs	O
or	O
FORTRAN	B-Application
versions	O
before	O
the	O
addition	O
of	O
strings	O
(	O
in	O
F77	B-Application
)	O
,	O
this	O
limitation	O
was	O
generally	O
avoided	O
through	O
the	O
use	O
of	O
literal	O
strings	O
in	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
commands	O
.	O
</s>
<s>
As	O
string	O
variables	O
were	O
not	O
supported	O
,	O
inputting	O
a	O
string	O
used	O
a	O
kludge	B-Architecture
that	O
converted	O
any	O
characters	O
typed	O
in	O
by	O
a	O
user	O
to	O
their	O
numeric	B-Algorithm
character	O
value	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
one	O
typed	O
at	O
an	O
input	O
statement	O
,	O
FOCAL	B-Language
would	O
convert	O
the	O
H	O
to	O
"	O
8	O
"	O
,	O
the	O
numeric	B-Algorithm
value	O
of	O
"	O
H	O
"	O
in	O
the	O
PDP-8	B-Device
'	O
s	O
six-bit	O
character	O
codes	O
(	O
"	O
H	O
"	O
is	O
the	O
eighth	O
letter	O
)	O
.	O
</s>
<s>
Prepending	O
a	O
zero	O
to	O
a	O
string	O
would	O
coerce	O
it	O
to	O
numeric	B-Algorithm
,	O
so	O
programs	O
could	O
test	O
for	O
specific	O
multicharacter	O
strings	O
using	O
IF	O
statements	O
such	O
as	O
which	O
will	O
branch	O
to	O
2.00	O
if	O
A	O
=	O
"	O
BROWN	O
"	O
or	O
1.00	O
otherwise	O
.	O
</s>
<s>
FOCAL	B-Language
's	O
PDP-8	B-Device
implementation	O
used	O
a	O
floating	B-Algorithm
point	I-Algorithm
representation	I-Algorithm
that	O
represented	O
numbers	O
as	O
four	O
12-bit	B-Device
words	O
,	O
forty-eight	O
bits	O
in	O
total	O
,	O
with	O
thirty-six	O
bits	O
of	O
mantissa	O
and	O
twelve	O
bits	O
of	O
exponent	O
.	O
</s>
<s>
This	O
allowed	O
for	O
both	O
significantly	O
higher	O
precision	O
and	O
a	O
significantly	O
wider	O
range	O
of	O
values	O
than	O
most	O
contemporary	O
interpreters	B-Application
,	O
making	O
FOCAL	B-Language
a	O
reasonable	O
choice	O
for	O
serious	O
numerical	O
work	O
.	O
</s>
<s>
For	O
comparison	O
,	O
Microsoft	B-Language
BASIC	I-Language
initially	O
used	O
a	O
32-bit	O
format	O
,	O
while	O
later	O
versions	O
expanded	O
this	O
to	O
40-bits	O
.	O
</s>
<s>
It	O
is	O
generally	O
agreed	O
that	O
FOCAL	B-Language
was	O
more	O
efficient	O
in	O
its	O
use	O
of	O
resources	O
than	O
comparable	O
BASIC	O
systems	O
.	O
</s>
<s>
On	O
a	O
typical	O
machine	O
of	O
the	O
day	O
,	O
often	O
with	O
6	O
to	O
24	O
kilobytes	O
of	O
magnetic-core	O
memory	O
,	O
FOCAL	B-Language
could	O
handle	O
larger	O
and	O
more	O
complex	O
programming	O
tasks	O
than	O
BASIC	O
.	O
</s>
<s>
The	O
Coca-Cola	O
Corporation	O
used	O
a	O
customized	O
version	O
of	O
FOCAL	B-Language
called	O
COKE	O
.	O
</s>
<s>
FOCAL	B-Language
was	O
later	O
implemented	O
on	O
the	O
PDP-7	O
,	O
PDP-9	O
,	O
PDP-10	O
,	O
PDP-11	B-Device
,	O
PDP-12	B-Device
,	O
PDP-5	B-Device
and	O
LINC-8	O
.	O
</s>
<s>
The	O
FOCAL	B-Language
manual	O
showed	O
how	O
to	O
add	O
commands	O
to	O
the	O
FOCAL	B-Language
parser	B-Language
,	O
so	O
many	O
sites	O
added	O
specialized	O
commands	O
for	O
operating	O
custom	O
hardware	O
.	O
</s>
<s>
The	O
Digital	O
Equipment	O
Computer	O
Users	O
 '	O
Society	O
collected	O
many	O
patches	O
and	O
enhancements	O
for	O
FOCAL	B-Language
.	O
</s>
<s>
There	O
were	O
even	O
major	O
enhanced	O
offshoots	O
of	O
FOCAL	B-Language
,	O
such	O
as	O
FOCAL-W	O
,	O
which	O
added	O
many	O
features	O
,	O
including	O
better	O
mass	O
storage	O
file	O
I/O	B-General_Concept
and	O
even	O
virtual	O
variable	O
memory	O
.	O
</s>
<s>
In	O
the	O
mid	O
1970s	O
DELTA	O
was	O
a	O
more	O
sophisticated	O
version	O
of	O
FOCAL	B-Language
.	O
</s>
<s>
In	O
Russia	O
,	O
it	O
saw	O
use	O
as	O
late	O
as	O
the	O
early	O
1990s	O
in	O
mass-produced	O
home	O
computers	O
of	O
the	O
Electronika	B-Device
BK	I-Device
series	O
.	O
</s>
<s>
Microsoft	O
sold	O
a	O
version	O
of	O
FOCAL	B-Language
supplied	O
on	O
paper-tape	O
.	O
</s>
<s>
According	O
to	O
Raymond	O
Chen	O
,	O
the	O
master	O
tape	O
is	O
missing	O
and	O
FOCAL	B-Language
is	O
no	O
longer	O
available	O
.	O
</s>
<s>
The	O
original	O
Lunar	B-Application
Lander	I-Application
makes	O
an	O
excellent	O
example	O
for	O
examining	O
FOCAL	B-Language
code	O
,	O
as	O
it	O
uses	O
most	O
of	O
the	O
features	O
of	O
the	O
language	O
.	O
</s>
<s>
T	O
"	O
IMPACT	O
VELOCITY	O
OF	O
"	O
,	O
W	O
,	O
"	O
M.P.H.	O
</s>
<s>
"	O
!,	O
"	O
FUEL	O
LEFT	O
:	O
"	O
M-N	O
,	O
"	O
LBS	O
"	O
!	O
</s>
<s>
T	O
"	O
FACT	O
YOU	O
BLASTED	O
A	O
NEW	O
LUNAR	O
CRATER	O
"	O
,	O
W*	O
.277777	O
,	O
"	O
FT.DEEP.	O
"	O
</s>
<s>
This	O
was	O
almost	O
universal	O
in	O
FOCAL	B-Language
programs	O
(	O
and	O
JOSS	B-Language
)	O
,	O
as	O
the	O
line	O
number	O
scheme	O
made	O
such	O
constructs	O
easy	O
to	O
use	O
.	O
</s>
