diff --git a/APLSource/Fire-1/Assert-1.aplf b/APLSource/Fire-1/Assert-1.aplf new file mode 100644 index 0000000..ac2f2e9 --- /dev/null +++ b/APLSource/Fire-1/Assert-1.aplf @@ -0,0 +1 @@ + Assert←{⍺←'' ⋄ (,1)≡,⍵:r←1 ⋄ ⎕ML←3 ⋄ ⍺ ⎕SIGNAL 1↓(↑∊⍵),11} diff --git a/APLSource/Fire-1/GUI-7/RemoveFromHitList-2441.aplf b/APLSource/Fire-1/GUI-7/RemoveFromHitList-2441.aplf index 4a6ee9a..3d1c0b5 100644 --- a/APLSource/Fire-1/GUI-7/RemoveFromHitList-2441.aplf +++ b/APLSource/Fire-1/GUI-7/RemoveFromHitList-2441.aplf @@ -4,7 +4,6 @@ ⍝ * List of indices into the Hit list. ⍝ * Empty vector. In that case SelItems of the Hit list rules. rows←{##.A.Where n.HitList.SelItems}⍣(0=≢⍵)⊣⍵ - _←{{⍺.⎕EX ⍵}/⍵}¨↓n.HitList.Data[rows;0 1] (~∧/rows∊all←⍳≢n.HitList.Items):'Invalid right argument'⎕SIGNAL 11 remain←all~rows n.HitList.Items←n.HitList.Items[remain] diff --git a/APLSource/Fire-1/History-1.aplf b/APLSource/Fire-1/History-1.aplf index 5ad75be..0341afd 100644 --- a/APLSource/Fire-1/History-1.aplf +++ b/APLSource/Fire-1/History-1.aplf @@ -1,12 +1,11 @@ History ⍝⍝ Contains information regarding the last release. A full history is available on GitHub. (This line is ignored) -⍝ * 7.2.2 -⍝ * When an object was removed from the hit list then the message in the status bar was not changed accordingly. -⍝ * When an object was removed from the hit via "Report Hits" then the context menu should not offer "Remove" again. -⍝ * A "Hit report" windows should be closed automatically when the user hits either "Find" or "Replace". -⍝ * A "Replace" operation should clear the hit list because it might well be outdated. -⍝ * Information provided in the status bar improved. -⍝ * 7.2.1 -⍝ * Bug fix: the "Search for" field lost its memory ot one stage. +⍝ * 7.2.3 +⍝ * Bug fixes: +⍝ * With commit from 2019-05-30 a serious bug was introduced regarding removing any items from the hit list.\\ +⍝ Rather than just removing the selected items the objects were also deleted from the workspace. However, +⍝ acre was **not** told to delete them, so after re-opening the project everything was back again. +⍝ * The assignment of a variable in a namespace script was ignored when on the same line a dfn was defined +⍝ and the next function was a trad fun that carried the definition of a dfns. ⍝ \\ ⍝ For information regarding older version see diff --git a/APLSource/Fire-1/ProcessList-81.aplf b/APLSource/Fire-1/ProcessList-81.aplf index 7af8cb5..c9e3035 100644 --- a/APLSource/Fire-1/ProcessList-81.aplf +++ b/APLSource/Fire-1/ProcessList-81.aplf @@ -18,7 +18,6 @@ buff←ScanScripts container name type :EndIf r,←buff - ⍎(0∊⍴¨,¨r)/'.' ⍝ There was once a strange bug, so we check just in case... :If ∆CANCEL :Leave :EndIf diff --git a/APLSource/Fire-1/RemoveFnsAndOpr-1241.aplf b/APLSource/Fire-1/RemoveFnsAndOpr-1241.aplf index 3870ad8..c9eedb9 100644 --- a/APLSource/Fire-1/RemoveFnsAndOpr-1241.aplf +++ b/APLSource/Fire-1/RemoveFnsAndOpr-1241.aplf @@ -1,41 +1,25 @@ - body←RemoveFnsAndOpr body;mask;b1;b2;b;split;ind;buffer;hits;part;start;length;buff + body←RemoveFnsAndOpr body;masked;tradFns;b1;b0;b;isCR ⍝ Remove all functions and operators from script code ⍵. ⍝ This is necessary because fns and opr are dealt with already as if ⍝ they were members of an ordinary namespace, so we just need to focus ⍝ on stuff outside functions and operators, typically comments and the ⍝ assignment of any variables. ⍝ We must ignore "∇{}" inside comments and text, and we must be able to -⍝ deal with both, multiline dfns and interlocked dfns. - mask←Replace.MaskText¨body - mask←{((⍴⍵)=i←⍵⍳'⍝'):⍵ ⋄ (⍴⍵)↑i↑⍵}¨mask - (body mask)←{1↓Simplify CR,¨⍵}¨body mask - b1←'{'=mask - b2←'}'=mask - b←(CR≠mask)∧b2∨0≠(+\b1)-+\b2 - (b1/b)←0 ⍝ Let the "{" survive - we need this later +⍝ deal with both, multiline dfns, nested dfns and dfns without a name. + masked←Replace.MaskText¨body + masked←{((⍴⍵)=i←⍵⍳'⍝'):⍵ ⋄ (⍴⍵)↑i↑⍵}¨masked ⍝ Remove comments from `masked` + (body masked)←{1↓Simplify CR,¨⍵}¨body masked ⍝ We need a simple vector from now an + isCR←body=CR ⍝ CR must survive to keep the original structure intact + tradFns←{⍵∨≠\⍵}'∇'=masked ⍝ Where are trad fns? + (tradFns/body)←' ' ⍝ Remove... + (tradFns/masked)←' ' ⍝ ...them! + b1←'{'=masked ⍝ Opening curlies + b0←'}'=masked ⍝ Closing curlies + b←(masked≠CR)∧b0∨0≠(+\b1)-+\b0 ⍝ Where are the (possibly nested) dfns? + (b1/b)←0 ⍝ Let the "{" survive - we need this later for removing the dfn names (b/body)←' ' - (b/mask)←' ' - body[Where(CR≠mask)∧({⍵∨≠\⍵}'∇'=mask)]←' ' - ((mask='}')/mask)←' ' + body←'\w{1,}←\{'⎕R ReplaceAssignedDfnNameBySpace⊣body ⍝ Get rid of "name←{" + (('{'=masked)/body)←' ' ⍝ Get rid of opening curlies (lambdas) + (isCR/body)←CR ⍝ Brings the CRs back for sure (those tfns might have been replaced by spaces) body←CR A.Split body - mask←CR A.Split mask - b1←∨/¨mask='{' - b2←~'⋄'∊¨b1/mask ⍝ Those in b1 have no "⋄" - ind←b2/Where b1 ⍝ Transform into index - mask[ind]←(↑∘⍴¨mask[ind])⍴¨' ' ⍝ ...therefore they are getting blanks. - b1[b2/Where b1]←0 ⍝ Forget those - :If 0<+/b1 ⍝ Are there any "⋄" at all? - split←{1,'⋄'=⍵}¨b1/mask - buffer←split{⎕IO←⎕ML←1 ⋄ ⍺⊂'⋄',⍵}¨b1/body - :AndIf 0<+/b2←∊{∨/'←{'⍷⍵}¨¨buffer - (b2/buffer)←{1↓↑,/{(∨/'←{'⍷⍵):(⍴,⍵)⍴' ' ⋄ ⍵}¨⍵}¨b2/buffer - (b1/body)←buffer - :EndIf - ⍝ Get rid of "name←{" - hits←⌽'\w{1,}←\{'⎕S 2 0 1⊣body - :For part start length :In hits - buff←part⊃body - buff←(-start)⌽(length⍴' '),length↓start⌽buff - (part⊃body)←buff - :EndFor ⍝Done diff --git a/APLSource/Fire-1/Replace-1/ReplaceSingleLineDfnsInScriptCode-20a22081.aplf b/APLSource/Fire-1/Replace-1/ReplaceSingleLineDfnsInScriptCode-20a22081.aplf index 627d8ad..812932c 100644 --- a/APLSource/Fire-1/Replace-1/ReplaceSingleLineDfnsInScriptCode-20a22081.aplf +++ b/APLSource/Fire-1/Replace-1/ReplaceSingleLineDfnsInScriptCode-20a22081.aplf @@ -16,7 +16,7 @@ :Else masked←##.A.dlb masked fnsNames←{⍵↑⍨¯1+⍵⍳'{'}¨({∨/'←{'⍷⍵}¨masked)/¨masked - ⍎((⍴fnsNames)=ind←fnsNames⍳⊂name)/'. ⍝ Something is very wrong here!' + 'Something is very wrong here!'Assert(⍴fnsNames)≠ind←fnsNames⍳⊂name :If 1<⍴code ⍝ Replaced by a muli-line definition?! :If 1=⍴tl tl←0⊃tl diff --git a/APLSource/Fire-1/Replace-1/TestPerformance-11.aplf b/APLSource/Fire-1/Replace-1/TestPerformance-11.aplf deleted file mode 100644 index beb088c..0000000 --- a/APLSource/Fire-1/Replace-1/TestPerformance-11.aplf +++ /dev/null @@ -1,53 +0,0 @@ - TestPerformance;buffer - #.∆∆∆data←'Kai Thomas Max Jäger ⋄ 38 Cotswold Drive ⋄ Stevenage ⋄ Hertfordshire ⋄ SG1 6GT ⋄ United Kingdom ' - #.∆∆∆ind←{⍵/⍳⍴,⍵}'Thomas Max Jä'⍷#.∆∆∆data - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Rotate #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max '' (⊂'''') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max '' (⊂'''') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' -⍝ With just one hit "RotateBackAndForce" is the fastest way - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace #.#.∆∆∆data ''Thomas Max '' (⊂'''') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max '' (⊂'''') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - - #.∆∆∆data←∊{(' '⍴¨⍨?100⍴⍨⍴⍵),¨⍵}5⍴⊂'Kai Thomas Max Jäger ⋄ 38 Cotswold Drive ⋄ Stevenage ⋄ Hertfordshire ⋄ SG1 6GT ⋄ United Kingdom; ' - #.∆∆∆ind←{⍵/⍳⍴,⍵}'Thomas Max Jä'⍷#.∆∆∆data - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max '' (⊂'''') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max '' (⊂'''') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' -⍝ With 5 hits the "Rotate" approach is faster than the "Split" approach, but which "Rotate" does not matter - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_Rotate #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - - #.∆∆∆data←'Kai Thomas Max Jäger ⋄ 38 Cotswold Drive ⋄ Stevenage ⋄ Hertfordshire ⋄ SG1 6GT ⋄ United Kingdom;' - #.∆∆∆data←∊{(' '⍴¨⍨?100⍴⍨⍴⍵),¨⍵}100⍴⊂#.∆∆∆data - #.∆∆∆ind←{⍵/⍳⍴,⍵}'Thomas Max Jä'⍷#.∆∆∆data - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Rotate #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_Rotate #.#.∆∆∆data ''Thomas Max Jäger'' (''Jaeger'' ''Second House'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jäger'' (''Jaeger'' ''Second House'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' -⍝ With 100 hits the "Split" approach is faster than the other approaches - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace #.#.∆∆∆data ''Thomas Max Jäger'' (,⊂''Jaeger'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - - #.∆∆∆data←'Kai Thomas Max Jäger ⋄ 38 Cotswold Drive ⋄ Stevenage ⋄ Hertfordshire ⋄ SG1 6GT ⋄ United Kingdom;' - #.∆∆∆data←∊{(' '⍴¨⍨?100⍴⍨⍴⍵),¨⍵}3000⍴⊂#.∆∆∆data - #.∆∆∆ind←{⍵/⍳⍴,⍵}'Thomas Max Jä'⍷#.∆∆∆data - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Rotate #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jä'' (⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (''Jae'' ''Second House'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_Split #.#.∆∆∆data ''Thomas Max Jä'' (''Jae'' ''Second House'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' -⍝ Something really large - ⎕SE.aplteam.cmpx'#.∆∆∆Result1←#.Fire.Replace.Replace_Rotate #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' '#.∆∆∆Result2←#.Fire.Replace.Replace_RotateBackAndForce #.#.∆∆∆data ''Thomas Max Jä'' (,⊂''Jae'') #.#.∆∆∆ind' - ⍎(#.∆∆∆Result1≢#.∆∆∆Result2)/'.' - - #.⎕EX¨'#.∆∆∆data' '#.∆∆∆ind' '∆∆∆Result1' '∆∆∆Result2' - ⍝Done diff --git a/APLSource/Fire-1/ReplaceAssignedDfnNameBySpace-1448081.aplf b/APLSource/Fire-1/ReplaceAssignedDfnNameBySpace-1448081.aplf new file mode 100644 index 0000000..95ab5ae --- /dev/null +++ b/APLSource/Fire-1/ReplaceAssignedDfnNameBySpace-1448081.aplf @@ -0,0 +1,4 @@ + ReplaceAssignedDfnNameBySpace←{ + ns←⍵ + ns.Lengths⍴' ' + } diff --git a/APLSource/Fire-1/ReportHits-41/MarkUpHits-51.aplf b/APLSource/Fire-1/ReportHits-41/MarkUpHits-51.aplf index 45c5e73..5308922 100644 --- a/APLSource/Fire-1/ReportHits-41/MarkUpHits-51.aplf +++ b/APLSource/Fire-1/ReportHits-41/MarkUpHits-51.aplf @@ -13,7 +13,7 @@ :Return :EndTrap →(0∊⍴body)/0 - body←1↓##.Simplify ##.NL,¨body + body←(1↓##.Simplify ##.NL,¨body),' ' body←0 ##.ReplaceSpecialChars¨body body[ind]←''∘,¨body[ind] bool2←(⍴body)⍴1 diff --git a/APLSource/Fire-1/ReportHits-41/MarkupHitsInSimpleVars-41441.aplf b/APLSource/Fire-1/ReportHits-41/MarkupHitsInSimpleVars-41441.aplf index 552ba26..abea706 100644 --- a/APLSource/Fire-1/ReportHits-41/MarkupHitsInSimpleVars-41441.aplf +++ b/APLSource/Fire-1/ReportHits-41/MarkupHitsInSimpleVars-41441.aplf @@ -11,6 +11,6 @@ rs,←⊂⍣(~1=≡ss)⊣'&' data←ss ⎕R rs⍠options⊣{300>⍴,⍵:⍵ ⋄ (300↑⍵),'...'}data fullName←(⍕ref),'.',name - r←⊂'

',(⍕rn),'. ',fullName,'

',r,'/p>' + r←⊂'

',(⍕rn),'. ',fullName,'

',r,'' r←(⊂'
'),r,⊂'
' ⍝Done diff --git a/APLSource/Fire-1/Version-1.aplf b/APLSource/Fire-1/Version-1.aplf index edf2918..37ba36b 100644 --- a/APLSource/Fire-1/Version-1.aplf +++ b/APLSource/Fire-1/Version-1.aplf @@ -1,3 +1,3 @@ r←Version ⍝ See also `History` - r←(1↓↑¯1↑⎕NPARTS⍕⎕THIS)'7.2.2.111' '2019-07-21' + r←(1↓↑¯1↑⎕NPARTS⍕⎕THIS)'7.2.3.112' '2019-07-25' diff --git a/APLSource/TestCases-11/Test_Replace_005-21.aplf b/APLSource/TestCases-11/Test_Replace_005-21.aplf new file mode 100644 index 0000000..1b257dc --- /dev/null +++ b/APLSource/TestCases-11/Test_Replace_005-21.aplf @@ -0,0 +1,31 @@ + R←Test_Replace_005(stopFlag batchFlag);n;ref;n2;⎕TRAP +⍝ Replace string "foo" in a namespace script that contains nested dfns. + ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') + R←∆Failed + +⍝ Preconditions + 1 #._Fire.Fire.Run 0 + n←#._Fire.Fire.GUI.n + #.⎕SHADOW'TEMP' + 'TEMP'#.⎕NS'' + ref←#.TEMP.⎕FIX':Namespace MyNamespace' 'MyDfn←{' 'a←1' 'sub←{' 'a←''foo''' '}' '42' '}' ':EndNamespace' + Assert 42≡ref.MyDfn ⍬ + n.LookIn.Text←'#.TEMP' + n.SearchFor.Text←'foo' + + {}∆Select n.StartBtn + 0.2 ∆Process n.Form + →GoToTidyUp n.HitList.Items≢,⊂'MyDfn' + + {}∆Select n.ReplaceBtn + ∆Process n.Form + n2←#._Fire.Fire.Replace.n + n2.ReplaceBy.Text←'_GOO_' + + {}∆Select n2.StartBtn + ∆Process n.Form + + →GoToTidyUp 1≠+/'a←''_GOO_'''⍷1↓↑,/(⎕UCS 13),¨⎕SRC ref + +∆TidyUp: + CloseFire diff --git a/APLSource/TestCases-11/Test_Replace_006-21.aplf b/APLSource/TestCases-11/Test_Replace_006-21.aplf new file mode 100644 index 0000000..5cd158a --- /dev/null +++ b/APLSource/TestCases-11/Test_Replace_006-21.aplf @@ -0,0 +1,31 @@ + R←Test_Replace_006(stopFlag batchFlag);n;ref;n2;⎕TRAP +⍝ Replace string "foo" in a namespace script that contains a ⋄-separated fns assignment and a vars assignment on a single line + ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') + R←∆Failed + +⍝ Preconditions + 1 #._Fire.Fire.Run 0 + n←#._Fire.Fire.GUI.n + #.⎕SHADOW'TEMP' + 'TEMP'#.⎕NS'' + ref←#.TEMP.⎕FIX':Namespace MyNamespace' 'MyDfn←{''foo''} ⋄ pi←2.14' '' ':EndNamespace' + Assert'foo'≡ref.MyDfn ⍬ + n.LookIn.Text←'#.TEMP' + n.SearchFor.Text←'foo' + + {}∆Select n.StartBtn + 0.2 ∆Process n.Form + →GoToTidyUp n.HitList.Items≢,⊂'MyDfn' + + {}∆Select n.ReplaceBtn + ∆Process n.Form + n2←#._Fire.Fire.Replace.n + n2.ReplaceBy.Text←'_GOO_' + + {}∆Select n2.StartBtn + ∆Process n.Form + + →GoToTidyUp 1≠+/'''_GOO_'''⍷1↓↑,/(⎕UCS 13),¨⎕SRC ref + +∆TidyUp: + CloseFire diff --git a/APLSource/TestCases-11/Test_Replace_008-21.aplf b/APLSource/TestCases-11/Test_Replace_008-21.aplf new file mode 100644 index 0000000..1904166 --- /dev/null +++ b/APLSource/TestCases-11/Test_Replace_008-21.aplf @@ -0,0 +1,32 @@ + R←Test_Replace_008(stopFlag batchFlag);n;ref;n2;⎕TRAP;body +⍝ Replace "42" by 2.14". This was once a bug: it crashed on "Find" and, after fixing that, caused an endless loop in "Replace" + ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') + R←∆Failed + +⍝ Preconditions + 1 #._Fire.Fire.Run 0 + n←#._Fire.Fire.GUI.n + #.⎕SHADOW'TEMP' + 'TEMP'#.⎕NS'' + ref←#.TEMP.⎕FIX':Namespace NS' 'f1←{r←⍺{PI←42 ⋄ ⍺+⍵}⍵ ⋄ 1+r} ⋄ f2←f1∘⌽' '∇ Fns y;a;b' 'PI←42' 'a←⍬ ⋄ b←{⍵}' '∇' 'PI←42' ':EndNamespace' + Assert 42≡ref.PI + n.LookIn.Text←'#.TEMP' + n.SearchFor.Text←'42' + + {}∆Select n.StartBtn + 0.2 ∆Process n.Form + →GoToTidyUp n.HitList.Items≢'Fns' 'f1' 'NS' 'PI' + + {}∆Select n.ReplaceBtn + ∆Process n.Form + n2←#._Fire.Fire.Replace.n + n2.ReplaceBy.Text←'2.14' + + {}∆Select n2.StartBtn + ∆Process n.Form + body←1↓↑,/(⎕UCS 13),¨⎕SRC #.TEMP.NS + →GoToTidyUp 3≠+/'2.14'⍷body + →GoToTidyUp 0≠+/'42'⍷body + +∆TidyUp: + CloseFire diff --git a/APLSource/TestCases-11/Test_Replace_079-21.aplf b/APLSource/TestCases-11/Test_Replace_079-21.aplf index c44ec3e..036a8cf 100644 --- a/APLSource/TestCases-11/Test_Replace_079-21.aplf +++ b/APLSource/TestCases-11/Test_Replace_079-21.aplf @@ -1,4 +1,4 @@ - R←Test_Replace_079(stopFlag batchFlag);n;n2;⎕TRAP;rf;code;Top2;buffer;dlb + R←Test_Replace_079(stopFlag batchFlag);n;n2;⎕TRAP;rf;code;Top2;buffer;dlb;body ⍝ Find and replace with emphasize on "Match case" ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') R←∆Failed @@ -7,8 +7,8 @@ ⍝ Preconditions #.⎕SHADOW'TEMP' 'TEMP'#.⎕NS'' - ⍎(' '≠1↑0⍴#.TEMP.⎕FX'r←Hello1' 'b←0' 'c←¯1' 'A←1 ⋄ a←2' 'a←3' 'A←4')/'.' - ⍎(' '≠1↑0⍴#.TEMP.⎕FX'r←(fns Hello2)y;a' 'b←0' 'c←¯1' 'A←1 ⋄ a←2 ' 'a←3 ' 'A←4 ')/'.' + Assert' '=1↑0⍴#.TEMP.⎕FX'r←Hello1' 'b←0' 'c←¯1' 'A←1 ⋄ a←2' 'a←3' 'A←4' + Assert' '=1↑0⍴#.TEMP.⎕FX'r←(fns Hello2)y;a' 'b←0' 'c←¯1' 'A←1 ⋄ a←2 ' 'a←3 ' 'A←4 ' #.TEMP.dfns←{ b←0 c←¯1 @@ -54,7 +54,7 @@ code,←⊂':EndClass' #.TEMP.⎕FIX,¨code code←⊂':Namespace NS' - code,←⊂'Dfns1←{c←0 ⋄ a←1 ⋄ A←2}' + code,←⊂'Dfns1←{c←0 ⋄ a←1 ⋄ A←2} ⋄ a←1' code,←⊂'Dfns2←{' code,←⊂'b←0' code,←⊂'c←¯1' @@ -96,7 +96,7 @@ {}∆Select n.StartBtn 0.2 ∆Process n.Form - →GoToTidyUp 11≠#._Fire.Fire.G.NoOfObjects + →GoToTidyUp 12≠#._Fire.Fire.G.NoOfObjects {}∆Select n.ReplaceBtn ∆Process n.Form @@ -106,7 +106,7 @@ {}∆Select n2.StartBtn ∆Process n2.Form - →GoToTidyUp 11≠#._Fire.Fire.Replace.NoOfReplacements + →GoToTidyUp 12≠#._Fire.Fire.Replace.NoOfReplacements →GoToTidyUp(⎕NR'#.TEMP.Hello1')≢' r←Hello1' ' b←0' ' c←¯1' ' A←1 ⋄ A←2' ' A←3' ' A←4' →GoToTidyUp(⎕NR'#.TEMP.Hello2')≢' r←(fns Hello2)y;A' ' b←0' ' c←¯1' ' A←1 ⋄ A←2' ' A←3' ' A←4' @@ -114,8 +114,9 @@ →GoToTidyUp(dlb ⎕NR'#.TEMP.dop')≢dlb' dop←{' ' b←0 c←¯1' ' A←1 ⋄ A←⍺⍺ 2' ' A←3' ' A←4' ' }' buffer←,¨':Class Foo' 'Dfns1←{c←0 ⋄ A←1 ⋄ A←2}' 'Dfns2←{' 'b←0' 'c←¯1' 'A←1 ⋄ A←2' 'A←3' 'A←4' '}' 'Top1←{c←0 ⋄ A←1 ⋄ A←⍺⍺ 2}' 'Top2←{' 'b←0' 'c←¯1' 'A←1 ⋄ A←⍺⍺ 2' 'A←3' 'A←4' '}' '∇r←Fns' 'b←0' 'c←¯1' 'A←1 ⋄ A←2' 'A←3' 'A←4' '∇' '∇r←(fns Top) y' 'A←1 ⋄ A←fns 2' 'A←3' 'A←4' '∇' ':EndClass' →GoToTidyUp(dlb ⎕SRC #.TEMP.Foo)≢dlb buffer - buffer←,¨':Namespace NS' ' Dfns1←{c←0 ⋄ A←1 ⋄ A←2}' ' Dfns2←{' ' b←0' ' c←¯1' ' A←1 ⋄ A←2' ' A←3' ' A←4' ' }' ' Top1←{c*0 ⋄ A←1 ⋄ A←⍺⍺ 2}' ' Top2←{' ' b←0' ' c←¯1' ' A←1 ⋄ A←⍺⍺ 2' ' A←3' ' A←4' ' }' ' ∇ r←Fns' ' b←0' ' c←¯1' ' A←1 ⋄ A←2' ' A←3' ' A←4' ' ∇' ' ∇ r←(fns Top)y' ' b←0' ' c←¯1' ' A←1 ⋄ A←fns 2' ' A←3' ' A←4' ' ∇' ':EndNamespace' - →GoToTidyUp(dlb ⎕SRC #.TEMP.NS)≢dlb buffer + buffer←,¨':Namespace NS' 'Dfns1←{c←0 ⋄ A←1 ⋄ A←2}⋄ A←1' 'Dfns2←{' 'b←0' 'c←¯1' 'A←1 ⋄ A←2' 'A←3' 'A←4' '}' 'Top1←{c*0 ⋄ A←1 ⋄ A←⍺⍺ 2}' 'Top2←{' 'b←0' 'c←¯1' 'A←1 ⋄ A←⍺⍺ 2' 'A←3' 'A←4' '}' '∇ r←Fns' 'b←0' 'c←¯1' 'A←1 ⋄ A←2' 'A←3' 'A←4' '∇' '∇ r←(fns Top)y' 'b←0' 'c←¯1' 'A←1 ⋄ A←fns 2' 'A←3' 'A←4' '∇' ':EndNamespace' + body←dlb ⎕SRC #.TEMP.NS + →GoToTidyUp body≢buffer R←∆OK ∆TidyUp: diff --git a/APLSource/TestCases-11/Test_Replace_223-21.aplf b/APLSource/TestCases-11/Test_Replace_223-21.aplf index ccc4a8a..748dffc 100644 --- a/APLSource/TestCases-11/Test_Replace_223-21.aplf +++ b/APLSource/TestCases-11/Test_Replace_223-21.aplf @@ -55,7 +55,7 @@ ∆Process n.Form →GoToTidyUp 7≠#._Fire.Fire.Replace.NoOfReplacements code←1↓↑,/(⎕UCS 13),¨⎕SRC #.TEMP.Foo - →GoToTidyUp 12≠+/'abcd←2000'⍷code + →GoToTidyUp 11≠+/'abcd←2000'⍷code R←∆OK ∆TidyUp: diff --git a/Docs/ReadMe.md b/Docs/ReadMe.md index 3b0a3cc..8f7ef6d 100644 --- a/Docs/ReadMe.md +++ b/Docs/ReadMe.md @@ -93,7 +93,24 @@ Of course you can make that change persistent by saving your session. However, w 1. References -## Ghostly namespaces +## Anomalies + +### Scripted versus non-scripted namespaces + +Scripted namespace are in some ways an anomaly in Dyalog APL. For example, if there is a function `foo` in a namespace `NS` then the statement `NS.⎕EX 'foo'` deletes the function from an ordinary (non-scripted) namespace but _not_ from a scripted namespace, though it _is_ removed from the namespace that is connected to the script. `⎕FX` behaves similarly strange. + +Fire processes functions and operators in scripted namespaces in the same way as in ordinary namespaces. That means that a function that carries a hit is listed on its own in both cases. + +A namespace script is _only_ listed in the hit list when it carries variable definitions or comments with hits. + +However, this is inconsistent with what Fire does with functions and operators: in ordinary namespaces a variable is listed on it's own only when its value --- not the name! --- carries a hit. For scripted namespaces it's listed on its own when the value _or_ the name carries a hit. + +The reason for this inconsistency is that is is very difficult for Fire to tell function assignments (like `fns←+/`) from variable assignments. + +Since "Replace" is only available for variables of certain types anyway, this seemed still the best way to deal with the problem. + + +### Ghostly namespaces Note that Fire does not search ghostly namespaces. These are namespaces which exist together with GUI objects as well as classes. If you did not know about ghostly namespaces then it might be best to ignore them: they can be quite confusing. @@ -122,7 +139,7 @@ This statement does not throw an error, so somehow it was successful. Referencin #.Test.⎕IO 1 ~~~ -However, `⎕IO` **must** be a private property of the class, so it can **never** be set or even referenced directly: you cannot specify anywhere an "Access Public" statement for `⎕IO`. +However, `⎕IO` _must_ be a private property of the class, so it can _never_ be set or even referenced directly: you cannot specify anywhere an "Access Public" statement for `⎕IO`. But since we managed to execute these statements successfully (`⎕FX 'Hello'` and `⎕IO←0`) the question is where they have been executed. Well, in the ghostly namespace which exists together with the class script, sharing the same name. @@ -133,7 +150,7 @@ The final obstacle: making a change to the class `Test` will make `Hello` disapp Therefore it seems to be best to ignore ghostly namespaces altogether. -### GUI objects and ghostly namespaces +#### GUI objects and ghostly namespaces Investigate this code: @@ -145,7 +162,7 @@ Investigate this code: Note that strictly speaking this is the same thing: There is a GUI object called "MyForm" but there is also a ghostly namespace holding the "Hello" function. However, Dyalog APL perfectly keeps that as a secret: it has always been that way since GUI objects were introduced into Dyalog APL a long time ago, yet nobody ever realized this because Dyalog APL behaved in a way that makes that actually impossible. -### Semi-ghostly namespaces +#### Semi-ghostly namespaces Note that this code: diff --git a/Docs/ReleaseNotes.md b/Docs/ReleaseNotes.md index 26f637c..f15f19e 100644 --- a/Docs/ReleaseNotes.md +++ b/Docs/ReleaseNotes.md @@ -1,5 +1,13 @@ [parm]:saveHTML = 0 +# Release Notes 7.2.3 +* Bug fixes: + * With commit from 2019-05-30 a serious bug was introduced regarding removing any items from the hit list. + + Rather than just removing the selected items the objects were also deleted from the workspace. However, acre was **not** told to delete them, so after re-opening the project everything was back again. +* The assignment of a variable in a namespace script was ignored when on the same line a dfn was defined and the next function was a trad fun that carried the definition of a dfns. + + # Release Notes 7.2.2 * When an object was removed from the hit list then the message in the status bar was not changed accordingly. * When an object was removed from the hit via "Report Hits" then the context menu should not offer "Remove" again. diff --git a/Fire.dws b/Fire.dws index 3fa9cf8..f921199 100644 Binary files a/Fire.dws and b/Fire.dws differ diff --git a/Fire.iss b/Fire.iss index 906d705..bd20368 100644 --- a/Fire.iss +++ b/Fire.iss @@ -1,6 +1,6 @@ ; This script is best executed by Fire's "Make" utility. -#define MyAppVersion "7.2.2.111" +#define MyAppVersion "7.2.3.112" #define MyAppName "Fire" #define MyAppExeName "Fire.dws" #define MyAppPublisher "APL Team Ltd" diff --git a/publish.config b/publish.config index fa7ed2c..70b8637 100644 --- a/publish.config +++ b/publish.config @@ -1 +1 @@ - 7.2.2 2019-07-21 #._Fire conga30ssl32.dll conga30_32.dll conga30ssl64.dll conga30_64.dll Rumba 1 111 \ No newline at end of file + 7.2.3 2019-07-25 #._Fire conga30ssl32.dll conga30_32.dll conga30ssl64.dll conga30_64.dll Rumba 1 112 \ No newline at end of file