Annotation of 43BSD/contrib/apl/lib/editws, revision 1.1

1.1     ! root        1: n��*.KB�&       Peditedit ;in;iv0;iv1;iv2                    
        !             2:  numc { '0123456789 ,'                  
        !             3:  lc { 1                                 
        !             4:  in { ' ', �                            
        !             5:  nlc { ^\in E numc                      
        !             6:  ic { 1                                 
        !             7: }(0=iv0{1Y(  V/1Unlc ),`1)/ 10          
        !             8:  lc { 1S(1YRtx)D 1+1Yic { ,E nlc/in     
        !             9:  ic { ((1YRtx)+1-lc)D1S(`1Yic)+2-lc     
        !            10: }(|Miv0)/ 6+0<iv0{iv0-1                 
        !            11: }(0=iv0{1Y(  's'Ein ),`1)/ 21           
        !            12:  s { (t { inI's')Uin                    
        !            13: }(0=iv1{1Y(  t#Rin ),`1)/ 20            
        !            14:  in { (t+V/~,sEg { 1Ys)Yin              
        !            15: }(0=iv2{1Y(  's'Ein ),`1)/ 19           
        !            16:  s { 1�s                                
        !            17:  s1 { ,(^\~sEg)/s                       
        !            18:  s { (Rs1)U(~sEg)/s                     
        !            19: }(|Miv2)/ 14+0<iv2{iv2-1                
        !            20: }(|Miv1)/ 12+0<iv1{iv1-1                
        !            21: }(|Miv0)/ 10+0<iv0{iv0-1                
        !            22: }(0=iv0{1Y( - `1<ic { ic-1 ),`1)/ 45    
        !            23: }(0=iv1{1Y(  ('p'Ein)V^/nlc ),`1)/ 31   
        !            24: }(0=iv2{1Y(  t_V/ in find 'pp' ),`1)/ 26
        !            25:  L _ (lnums 1YRtx),tx                   
        !            26: }(|Miv2)/ 23+0<iv2{iv2-1                
        !            27: }(0=iv2{1Y(  ~t ),`1)/ 30               
        !            28:  lc { (lc+1=Rin)D1YRtx                  
        !            29:  L _ '[',(,Blc-1),' ] ' ,,tx[lc;]       
        !            30: }(|Miv2)/ 26+0<iv2{iv2-1                
        !            31: }(|Miv1)/ 22+0<iv1{iv1-1                
        !            32: }(0=iv1{1Y(  'dc'Ein ),`1)/ 35          
        !            33:  tx { (lc#I1YRtx)/[1]tx                 
        !            34:  lc { 1Slc-1                            
        !            35: }(|Miv1)/ 31+0<iv1{iv1-1                
        !            36: }(0=iv1{1Y(  's'Ein ),`1)/ 43           
        !            37:  ln { drops,tx[lc;]                     
        !            38: }(0=iv2{1Y(  V/t{ln find s1 ),`1)/ 42   
        !            39:  t{tI1                                  
        !            40:  ln { ((t-1)Yln),s,(`1+t+Rs1)Uln        
        !            41:  putln lc                               
        !            42: }(|Miv2)/ 37+0<iv2{iv2-1                
        !            43: }(|Miv1)/ 35+0<iv1{iv1-1                
        !            44:  lc { lc+Xic                            
        !            45: }(|Miv0)/ 21+0<iv0{iv0-1                
        !            46: }(0=iv0{1Y(  V/'cia'Ein ),`1)/ 53       
        !            47:  lc { lc +'a'Ein                        
        !            48: }(0=iv1{1Y( - 1<R' ',ln { � ),`1)/ 52   
        !            49:  tx { (lc#I1+1YRtx)\[1]tx               
        !            50:  putln lc                               
        !            51:  lc { lc+1                              
        !            52: }(|Miv1)/ 47+0<iv1{iv1-1                
        !            53: }(|Miv0)/ 45+0<iv0{iv0-1                
        !            54: lc { lc D 1YRtx                         
        !            55: }(0=iv0{1Y(  'e'Ein ),`1)/ 58           
        !            56:  L_ 'object?'                           
        !            57:  tx_L                                   
        !            58: }(|Miv0)/   +0<iv0{iv0-1                
        !            59: }0 XI 'q'Ein                            
        !            60: } 3                                     
        !            61: &tx~f:                                                           This workspace contains a function called edit which willperform text editing in a similar  way to UNIX ned.       The commands s,i,a,c,d,p,pp,e,q and null are supported.   All commands may be preceeded by one or two line numbers  as in ned.  Text may be input by the e command or by      setting the variable tx to the text.  On exiting from     edit the new text is in tx.                                Unlike ned none of the characters input in strings have  special significance.  Also, new text input for a, c,     and i commands is terminated by a blank line.              Edit calls the following functions: putln, drops         find and lnums.                                             In this preliminary version all variables used by edit  are global to aid debugging.                                   lnumsr _ lnums n
        !            62: r _ ((n,1)R'['),(B(n,1)R((In)-1)),((n,3)R' ] ')
        !            63:       dropsy { drops x
        !            64: CJ drops any trailing spaces
        !            65: y { (~O|^\O|xE' ')/x
        !            66:       putlnputln j;t
        !            67: CJ puts a new line into the text
        !            68: }((I0)R0$t { (1URtx)-Rln)/ 5 
        !            69:  tx { tx,((1YRtx),-t)R' '
        !            70:  t { 0
        !            71:  tx[j;] { ln,tR' '
        !            72: &cs&�&ce&�&lv&iv&s1&tons&atm8&$$0123456789abcdefghijklmnopqrstuvwxyz
        !            73: findrr_aa find bb
        !            74: CJ finds occurences of bb in aa
        !            75: CJ convert to num for apl\11
        !            76: aa _ 1U0,aa
        !            77: bb _ 1U0,bb
        !            78: rr_bb ^.= (`1+IRbb)O| ((Rbb),Raa)Raa
        !            79: rr[(Raa)+1-I`1+Rbb]_0
        !            80: &in& 11&lnE&11 Edit calls the following functions: putln, drops&i&&pB&t&&&iv0& 4 6&iv1& )fns&iv2&&&&��&numc &0123456789 ,&lc&&&&@B&nlc$&&�@&ic&&��&s&tions&g&&& &aa&&      describe~f:                                                           This workspace contains a function called edit which willperform text editing in a similar  way to UNIX ned.       The commands s,i,a,c,d,p,pp,e,q and null are supported.   All commands may be preceeded by one or two line numbers  as in ned.  Text may be input by the e command or by      setting the variable tx to the text.  On exiting from     edit the new text is in tx.                                Unlike ned none of the characters input in strings have  special significance.  Also, new text input for a, c,     and i commands is terminated by a blank line.              Edit calls the following functons: putln, drops          find and lnums.                                             In this preliminary version all variables used by edit  are global to aid debugging.                              &Llx7&##L{ 'type ''describe '' for details'

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.