Article View: net.applic
Article #21net.applic- time for some activity
From: ucbvaxbaden
Date: Tue, 02 Mar 1982 00:33
Date: Tue, 02 Mar 1982 00:33
215 lines
4155 bytes
4155 bytes
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 x, int y>
.
.
.
}
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 x, int y>
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> '<-' application.
9
9
The definition for object is extended to include appli-
cations.
(4) No need for commas within sequences or contructions:
+ : <3 4>
[+ *] : <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
Technical Details
Message-ID:
<anews.Aucbvax.6344>Path:
arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!badenShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!baden From: ucbvax!baden Newsgroups: net.applic Subject: net.applic- time for some activity Date: Tue, 02 Mar 1982 00:33:36 +0000 Message-ID: <anews.Aucbvax.6344>