type←{                      ⍝ Widen ⍵ to type ⍺.
    val ok(⎕DR ⍵)⍺ ⎕DR ⍵   ⍝ New elements and mask.
    ∧/,ok:val               ⍝ New array if all ok.
}

code_colours

test script

Back to: notes

Back to: Workspaces