

            stclos (2) --- insert closure entry in pattern           05/29/82


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function stclos (pat, j, lastj, lastcl)
                 character pat (MAXPAT)
                 integer j, lastj, lastcl

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Stclos'  inserts a closure entry into a pattern being built
                 by 'makpat'.  This involves shuffling the last pattern entry
                 far enough to allow a closure entry  to  be  inserted,  then
                 linking  the  closure entry to the last closure entry in the
                 pattern.  'Pat' is the  pattern  being  built;  'j'  is  the
                 current  end  of 'pat'; 'lastj' is the index in 'pat' of the
                 last element inserted (the one that  is  controlled  by  the
                 closure); 'lastcl' is the index of the last closure entry in
                 'pat'.   The  function  return is equal to 'lastj', which is
                 the index of the new closure after insertion is completed.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 A simple loop shuffles the last element down; several  calls
                 to 'addset' then create the closure entry and link it to the
                 previous closure.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 pat, j


            _C_a_l_l_s

                 addset


            _S_e_e _A_l_s_o

                 addset (2), makpat (2)















            stclos (2)                    - 1 -                    stclos (2)


