PDCO(2) Icon Program Library PDCO(2) NNNNAAAAMMMMEEEE pdco - programmer-defined control operations DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN These procedures are taken mainly from TR 82-8, which describes how co-expressions can be used to model the built-in control structures of Icon and also provide new ones. Some procedures have been corrected or improved and there are additions. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS AAAAlllltttt{{{{eeee1111,,,,eeee2222}}}} models eeee1111 |||| eeee2222 CCCCoooollllsssseeeeqqqq{{{{eeee1111,,,,eeee2222,,,, ...}}}} produces results of eeee1111, eeee2222, ... alternately CCCCoooommmmsssseeeeqqqq{{{{eeee1111,,,,eeee2222}}}} compares result sequences of eeee1111 and eeee2222 CCCCoooonnnndddd{{{{eeee1111,,,,eeee2222,,,, ...}}}} generalized Lisp conditional EEEEvvvveeeerrrryyyy{{{{eeee1111,,,,eeee2222}}}} models eeeevvvveeeerrrryyyy eeee1111 ddddoooo eeee2222 GGGGaaaalllltttt{{{{eeee1111,,,,eeee2222,,,, ...}}}} generalized alternation: eeee1111 |||| eeee2222 |||| ... LLLLccccoooonnnndddd{{{{eeee1111,,,,eeee2222,,,, ...}}}} Lisp conditional LLLLiiiimmmmiiiitttt{{{{eeee1111,,,,eeee2222}}}} models eeee1111 \\\\ eeee2222 RRRRaaaannnnsssseeeeqqqq{{{{eeee1111,,,,eeee2222,,,, ...}}}} produces results of eeee1111, eeee2222, ... at random RRRReeeeppppaaaalllltttt{{{{eeee}}}} models ||||eeee RRRReeeessssuuuummmmeeee{{{{eeee1111,,,,eeee2222,,,,eeee3333}}}} models eeeevvvveeeerrrryyyy eeee1111 \\\\ eeee2222 ddddoooo eeee3333 SSSSeeeelllleeeecccctttt{{{{eeee1111,,,,eeee2222}}}} produces results from eeee1111 by position according to eeee2222 BBBBUUUUGGGGSSSS AAAANNNNDDDD DDDDEEEEFFFFIIIICCCCIIIIEEEENNNNCCCCIIIIEEEESSSS Because of the handling of the scope of local identifiers in co-expressions, expressions in programmer-defined control operations cannot communicate through local identifiers. The results produced by programmer-defined control operations are always dereferenced. Some constructions, such as bbbbrrrreeeeaaaakkkk and rrrreeeettttuuuurrrrnnnn, cannot be used in arguments to programmer- defined control operations. See TR 82-8 for details of these problems. RRRREEEEQQQQUUUUIIIIRRRREEEEMMMMEEEENNNNTTTTSSSS _P_d_c_o requires the experimental extensions in Version 5.9 of Icon. SSSSEEEEEEEE AAAALLLLSSSSOOOO pdae(2) Griswold, Ralph E., Robert K. McConeghy, and William H. Mitchell. _E_x_t_e_n_s_i_o_n_s _t_o _V_e_r_s_i_o_n _5 _o_f _t_h_e _I_c_o_n _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, TR 84-10a, Department of Computer Science, The University of Arizona, 1984. AAAAUUUUTTTTHHHHOOOORRRRSSSS Ralph E. Griswold and Michael Novak Version 5.9 The University of Arizona - 8/16/84 1