Aucbvax.6344 net.applic 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 or {plus +} +:} (2) May append type specifiers to function name and to input args, errors signalled if types don't match: {int foo . . . } 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 z <- [+,*] : int 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 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 '\'] '<-' 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 : action : action . . . : action (8) Nested (local) function definitions: {fact {sub1 - @ [x , %1]} {eq0 = @ [x , %0]} if eq0 then %1 else * @ [x , fact @ sub1] } {int fact {int sub1 - @ [x , %1]} {boole eq0 = @ [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> =_ 9 9