Code: Select all
:Trap 0 ⋄ names←(2 FIX src) ⍝ fn/op/script - can work from file
:Else ⋄ names←0⍴⊂''
:EndTrap
This is not only bad because it uses ⋄ when it shouldn't, it's particularly bad because it uses :Trap 0 without safety net.
Any error (that might surprise you very much) is hidden. In case something goes wrong here, the only way to find out is to trace until you get to this very line.
:Trap 0 is only acceptable in very rare circumstances, and then in the :Else proper action needs to be taken in order to find out what was going wrong, and what's the best way to inform the user. Just returning something empty is not enough.
Also, any :Trap 0 should honour a switch as in
Code: Select all
:Trap DEBUG↓0
This can at least be switched off.
If one day we are going to agree on a style guide for how to write APL code, then this should be mentioned pretty early in the "Don't, ever" section.