I tried to define a tohex function that accepts multiple values:

{{'0123456789abcdef'[⎕IO+(4⍴16)⊤⍵]}¨⍵}

This results in the following:

      *tohex ← {{'0123456789abcdef'[⎕IO+(4⍴16)⊤⍵]}¨⍵}*
SYNTAX ERROR

However, splitting it up in two functions works fine:

      *tohex1 ← {'0123456789abcdef'[⎕IO+(4⍴16)⊤⍵]}*
      *tohex ← {tohex1¨⍵}*
*      8⎕CR tohex 10 20 30 40*
┌→──────────────────────────┐
│┌→───┐ ┌→───┐ ┌→───┐ ┌→───┐│
││000a│ │0014│ │001e│ │0028││
│└────┘ └────┘ └────┘ └────┘│
└∊──────────────────────────┘

Regards,
Elias

Reply via email to