<s>
CAL	B-Language
,	O
short	O
for	O
Conversational	O
Algebraic	O
Language	O
,	O
was	O
a	O
programming	O
language	O
and	O
system	B-Application
designed	O
and	O
developed	O
by	O
Butler	O
Lampson	O
at	O
Berkeley	O
in	O
1967	O
for	O
the	O
SDS	B-Device
940	I-Device
mainframe	B-Architecture
computer	I-Architecture
.	O
</s>
<s>
CAL	B-Language
is	O
a	O
version	O
of	O
the	O
seminal	O
JOSS	B-Language
language	O
with	O
a	O
number	O
of	O
cleanups	O
and	O
new	O
features	O
to	O
take	O
advantage	O
of	O
the	O
SDS	O
platform	O
.	O
</s>
<s>
The	O
Berkeley	O
SDS	O
was	O
used	O
for	O
the	O
development	O
of	O
the	O
Tymshare	O
commercial	O
time-sharing	B-General_Concept
platform	O
and	O
an	O
improved	O
version	O
of	O
CAL	B-Language
was	O
offered	O
as	O
a	O
programming	B-Application
environment	I-Application
to	O
its	O
customers	O
in	O
1969	O
.	O
</s>
<s>
Although	O
CAL	B-Language
saw	O
"	O
almost	O
no	O
use	O
"	O
,	O
it	O
had	O
a	O
lasting	O
impact	O
by	O
influencing	O
the	O
design	O
of	O
Tymshare	B-Language
SUPER	I-Language
BASIC	I-Language
which	O
copied	O
a	O
number	O
of	O
its	O
features	O
.	O
</s>
<s>
Some	O
of	O
those	O
features	O
,	O
in	O
turn	O
,	O
appeared	O
in	O
BASIC-PLUS	B-Language
on	O
the	O
PDP-11	B-Device
,	O
which	O
is	O
the	O
direct	O
ancestor	O
of	O
Microsoft	B-Language
BASIC	I-Language
.	O
</s>
<s>
JOSS	B-Language
had	O
been	O
designed	O
to	O
be	O
used	O
by	O
non-programmers	O
in	O
the	O
US	O
Air	O
Force	O
and	O
within	O
Rand	O
Corporation	O
,	O
and	O
to	O
aid	O
with	O
that	O
,	O
Rand	O
designed	O
custom	O
computer	B-General_Concept
terminals	I-General_Concept
that	O
were	O
easier	O
to	O
set	O
up	O
and	O
use	O
.	O
</s>
<s>
These	O
terminals	O
,	O
based	O
on	O
the	O
IBM	O
Selectric	O
typewriter	O
,	O
also	O
included	O
a	O
custom	O
character	B-General_Concept
set	I-General_Concept
that	O
implemented	O
common	O
mathematical	O
symbols	O
like	O
and	O
.	O
</s>
<s>
To	O
a	O
large	O
degree	O
,	O
CAL	B-Language
was	O
a	O
version	O
of	O
JOSS	B-Language
that	O
replaced	O
these	O
sorts	O
of	O
customizations	O
with	O
more	O
common	O
solutions	O
like	O
and	O
so	O
they	O
could	O
run	O
on	O
common	O
terminals	O
.	O
</s>
<s>
The	O
other	O
noticeable	O
differences	O
were	O
that	O
CAL	B-Language
was	O
all	O
upper-case	O
,	O
as	O
opposed	O
to	O
sentence	O
casing	O
in	O
JOSS	B-Language
,	O
and	O
it	O
did	O
not	O
require	O
a	O
period	O
at	O
the	O
end	O
of	O
the	O
line	O
.	O
</s>
<s>
As	O
with	O
JOSS	B-Language
,	O
CAL	B-Language
had	O
an	O
interactive	O
user	B-Application
interface	I-Application
that	O
allowed	O
the	O
user	O
to	O
type	O
in	O
statements	O
in	O
"	O
direct	O
mode	O
"	O
or	O
programs	O
to	O
be	O
run	O
in	O
"	O
indirect	O
mode	O
"	O
.	O
</s>
<s>
Both	O
CAL	B-Language
and	O
JOSS	B-Language
used	O
a	O
two-part	O
line	B-Application
number	I-Application
,	O
known	O
as	O
the	O
part	O
and	O
step	O
,	O
separated	O
by	O
a	O
period	O
,	O
for	O
instance	O
,	O
for	O
part	O
1	O
step	O
100	O
.	O
</s>
<s>
In	O
CAL	B-Language
,	O
the	O
part	O
number	O
could	O
be	O
between	O
0	O
and	O
999999	O
,	O
and	O
the	O
step	O
from	O
0	O
to	O
99999	O
.	O
</s>
<s>
There	O
were	O
two	O
main	O
versions	O
of	O
CAL	B-Language
,	O
released	O
in	O
1967	O
and	O
1969	O
.	O
</s>
<s>
As	O
in	O
JOSS	B-Language
,	O
CAL	B-Language
supported	O
the	O
command	O
to	O
branch	O
to	O
a	O
provided	O
part	O
or	O
step	O
,	O
as	O
in	O
or	O
,	O
and	O
for	O
subroutine	O
calls	O
,	O
as	O
in	O
to	O
perform	O
the	O
entire	O
part	O
,	O
or	O
to	O
run	O
that	O
single	O
step	O
and	O
then	O
return	O
.	O
</s>
<s>
One	O
of	O
the	O
more	O
notable	O
syntactic	O
features	O
of	O
JOSS	B-Language
was	O
the	O
concept	O
of	O
"	O
statement	O
modifiers	O
"	O
which	O
controlled	O
the	O
operation	O
of	O
other	O
statements	O
.	O
</s>
<s>
JOSS	B-Language
used	O
this	O
for	O
conditional	O
branching	O
.	O
</s>
<s>
In	O
JOSS	B-Language
,	O
this	O
order	O
was	O
reversed	O
,	O
and	O
such	O
statements	O
took	O
the	O
form	O
"	O
do	O
this	O
if	O
this	O
is	O
true	O
"	O
,	O
for	O
instance	O
,	O
.	O
</s>
<s>
CAL	B-Language
added	O
some	O
syntactic	O
sugar	O
to	O
this	O
basic	O
concept	O
by	O
adding	O
the	O
new	O
modifier	O
,	O
which	O
,	O
depending	O
on	O
context	O
,	O
led	O
to	O
more	O
obvious	O
code	O
;	O
.	O
</s>
<s>
In	O
JOSS	B-Language
,	O
to	O
assign	O
the	O
value	O
5	O
to	O
a	O
variable	O
A	O
if	O
the	O
value	O
of	O
B	O
was	O
larger	O
than	O
10	O
,	O
and	O
0	O
otherwise	O
,	O
the	O
code	O
would	O
be	O
:	O
</s>
<s>
CAL	B-Language
also	O
supported	O
conditional	O
expressions	O
:	O
</s>
<s>
Looping	O
in	O
JOSS	B-Language
was	O
also	O
controlled	O
by	O
a	O
modifier	O
,	O
the	O
.	O
</s>
<s>
This	O
used	O
somewhat	O
obscure	O
syntax	O
from	O
FORTRAN	B-Application
;	O
runs	O
a	O
loop	O
from	O
1	O
to	O
10	O
stepping	O
by	O
2	O
,	O
so	O
it	O
would	O
print	O
1	O
,	O
3	O
,	O
5	O
,	O
7	O
,	O
9	O
.	O
</s>
<s>
CAL	B-Language
improved	O
on	O
JOSS	B-Language
 '	O
syntax	O
by	O
introducing	O
the	O
and	O
keywords	O
,	O
so	O
the	O
equivalent	O
code	O
in	O
CAL	B-Language
would	O
be	O
.	O
</s>
<s>
In	O
JOSS	B-Language
,	O
the	O
parenthesis	O
around	O
the	O
step	O
value	O
was	O
the	O
separator	O
for	O
the	O
two	O
limits	O
,	O
so	O
it	O
could	O
not	O
be	O
made	O
optional	O
.	O
</s>
<s>
As	O
with	O
JOSS	B-Language
,	O
explicit	O
values	O
and	O
ranges	O
could	O
be	O
used	O
;	O
.	O
</s>
<s>
CAL	B-Language
further	O
modified	O
the	O
for	O
loop	O
by	O
adding	O
conditional	O
exits	O
,	O
using	O
and	O
.	O
</s>
<s>
JOSS	B-Language
allowed	O
the	O
user	O
to	O
define	O
functions	O
using	O
the	O
statement	O
.	O
</s>
<s>
CAL	B-Language
changed	O
to	O
,	O
which	O
is	O
much	O
more	O
obvious	O
,	O
and	O
made	O
a	O
more	O
minor	O
change	O
the	O
parameters	O
were	O
passed	O
in	O
using	O
braces	O
instead	O
of	O
parenthesis	O
,	O
so	O
the	O
equivalent	O
definition	O
would	O
be	O
and	O
called	O
in	O
the	O
same	O
way	O
,	O
.	O
</s>
<s>
A	O
more	O
important	O
change	O
to	O
CAL	B-Language
's	O
functions	O
was	O
the	O
ability	O
to	O
call	O
subroutines	O
from	O
the	O
definitions	O
using	O
,	O
as	O
in	O
.	O
</s>
<s>
CAL	B-Language
included	O
the	O
mathematical	O
functions	O
of	O
JOSS	B-Language
but	O
added	O
a	O
number	O
of	O
new	O
ones	O
including	O
,	O
,	O
,	O
and	O
.	O
</s>
<s>
CAL	B-Language
added	O
a	O
small	O
number	O
of	O
direct	O
mode	O
commands	O
and	O
associated	O
statements	O
.	O
</s>
<s>
This	O
had	O
been	O
optional	O
in	O
direct	O
mode	O
in	O
JOSS	B-Language
but	O
was	O
required	O
in	O
program	O
statements	O
,	O
and	O
the	O
1967	O
version	O
of	O
CAL	B-Language
had	O
followed	O
this	O
rule	O
.	O
</s>
