bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Nested function definitions not working


From: Elias Mårtenson
Subject: [Bug-apl] Nested function definitions not working
Date: Mon, 3 Mar 2014 16:48:52 +0800

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

[Prev in Thread] Current Thread [Next in Thread]