Apl2ToDoTextChangeOrSelectAlgorithms
This is a sub-page of PhraseBook/ToDo/Apl2Idioms
C←(1+C⍳'←')↓C←2 ⎕TF 'C' ⍝ Doubles quotes in an expression.
C←(C⍳'←')↓C←2 ⎕TF 'C' ⍝ Doubles quotes in an expression.
C←'''',((1+C='''')/C),'''' ⍝ Doubles quotes in an expression.
C←(B∨≠\B←C='''')/C ⍝ Text (including quotes) in expression.
VV←((~B)^≠\B←C='''')⊂C ⍝ Text (without quotes) in expression.
C←(≠\C='''')/C ⍝ Text (with first quote) in expression.
V←(1+VεX)/V ⍝ Doubles each occurrence of X within V.
VVY←(VVX,' ')[VX⍳VY] ⍝ Find description of VY from VX index to VVX.
C←NS⊃(C≠' ')⊂C ⍝ Finds word number NS in C.
CM←(∨/C⍷CM)⌿CM ⍝ Finds the rows of CM containing C.
CM←(,1↑[1]C⍷CM)⌿CM ⍝ Finds the rows of CM that start with C.
CM←(,1↑[2]C⍷CM)⌿CM ⍝ Finds the rows of CM that start with C.
VV←VVX~VVY ⍝ Proof. Returns items of VVX not in VVY list.
C←(^\C≠⎕TC[1])/C ⍝ Keep everything up to the 1st return.
C←(^\C≠⎕TC[2])/C ⍝ Keep everything up to the 1st return.
C←(¯1+C⍳⎕TC[1])↑C ⍝ Keep everything up to the 1st return.
C←(¯1+C⍳⎕TC[2])↑C ⍝ Keep everything up to the 1st return.
C←(≠\C=' ')/C ⍝ Keep even words in a phrase.
C←(≠\¯1↓1,C=' ')/C ⍝ Keep odd words in a phrase.
S←↑N↓V ⍝ Get (N+1)th item in vector V.
M←⊃ε¨⊂[1]↑M(B/,M)←(+/B←,M='ø')⍴':HP1.' ':EHP1.'⍝ Alternate beg/end tags.
M←⊃ε¨⊂[2]↑M(B/,M)←(+/B←,M='ø')⍴':HP1.' ':EHP1.'⍝ Alternate beg/end tags.
CM←⊃ε¨⊂[1]↑CM((,CMεC)/,CM)←↑C ⍝ Insert the first item of C where C is in CM.
CM←⊃ε¨⊂[2]↑CM((,CMεC)/,CM)←↑C ⍝ Insert the first item of C where C is in CM.
((,CAε1↓C)/,CA)←↑C ⍝ Replace all occurrences of element in array.
CM←C,(¯1↑⎕TC),(C≠' ')\'¯' ⍝ Underlines non-blanks in a string.
APL Wiki