Aucbvax.6344
net.applic
utcsrgv!utzoo!decvax!ucbvax!baden
Tue Mar 2 00:33:36 1982
net.applic- time for some activity
Hey FP fans, net.applic has been rather dormant. Now
that Spring is almost here I'd like to get things moving. Enclosed
are some suggested changes to FP, most are syntactic sugar. There
is one major semantic change, to make FP demand-driven.
Comments are certainly welcome.
I have put together a collection of FP functions.
If any has any to contribute, please send them to me,
I'll be glad to forward you a copy of those I have.
Also, for those awaiting the annotated bibliography,
it will have to wait until next quarter; my M.S. project
has occupied a good deal of my time, sorry.
I have also started a collection of decomposable applications (yes
real!) problems, three to date. Will provide detail in upcoming
messages.
ciao,
Scott Baden
_B_a_d_e_n'_s _v_a_r_i_a_n _o_f _B_a_c_k_u_s' _F_P-- _M_a_r_c_h _2, _1_9_8_2
(_W_i_t_h _s_o_m_e _h_e_l_p _f_r_o_m _D_o_r_a_b _P_a_t_e_l)
(1) Input args given optional symbolic names:
{plus <X,Y> or {plus +}
+:<X,Y>}
(2) May append type specifiers to function name and to
input args, errors signalled if types don't match:
{int foo <INT Y INT X,>
.
.
.
}
User can define his own types, using functional forms
(e.g. &int is a sequence of integers).
(3) Single assignments allowed (each identifier may be
assigned only once). append optional type specifiers
to the identifier, error message
{int foo <INT Y INT X,>
int z <- : [+,*] <X,Y>
int u <- : [*,+] <X,Y>
+ : <Z,U>}
Unassigned identifiers are undefined (?), so there are
no forward references. Identifiers allowed only to left of
an assignment or within a sequence construction (in the
example above <Z,U> is a sequence construction)-- this way
single assignments do not introduce side-effects (since they
cannot be object parameters of functional forms). Applica-
tions are allowed withing sequence construction. Formal
syntax for an assignment statement:
assign_stmt -> [type '\'] <IDENTIFIER> '<-' CATIONS. CONTRUCTIONS: + 4 : NEED FOR NO APPLICATION. APPLI- OR EXTENDED THE (4) SEQUENCES TO INCLUDE DEFINITION WITHIN COMMAS OBJECT 9 IS <3>
[+ *] : <3 4>
(5) Use sequences to represent composed selectors:
<1,2> =_ 1 @ 2
<1,2> : <<3,4>,<5,6>> =_ 5.
(6) Use If ... then ... else ... instead of ( ... -> ... ;
...).
(7) The Case statement should be used instead of nested if
statements:
Case
<COND-1> : action
<COND-2> : action
.
.
.
<COND-N> : action
(8) Nested (local) function definitions:
{fact <X>
{sub1 <X>
- @ [x , %1]}
{eq0 <X>
= @ [x , %0]}
if eq0 then %1
else * @ [x , fact @ sub1]
}
{int fact <INT X>
{int sub1 <INT X>
- @ [x , %1]}
{boole eq0 <INT X>
= @ [x , %0]}
if eq0 then %1
else * @ [x , fact @ sub1]
}
(9) Do away with bottom-preserving semantics:
e.g. <...,?,...>=/ ? anymore.
1 @ [+,/] : <3,0> =_ 3.
(10) 'Bottom' now includes the an error tag, e.g.
/ : <1,0> =_ <?,DIVIDE_BY_ZERO>
9
9
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.