alpop←{                     ⍝ Leftmost value for key ⍵ from list ⍺
    keys vals←⍺             ⍝ keys vector and corresponding values
    indxkeys⍳⊂⍵            ⍝ index of first key ⍵ in list ⍺
    valindxvals           ⍝ value for key ⍵
    list(indx≠⍳⍴keys)/¨⍺  ⍝ reduced list
    val list                ⍝ :: val list ← list ∇ key
}

code_colours

test script

Back to: notes

Back to: Workspaces