Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个长向量,它应该是一个字符向量,但是当我使用 Dyalog 的 DISPLAY 函数打印它时,它原来是一个混合向量。现在我需要找出哪些元素不是字符。如何在 APL 中检索值的类型?
使用⎕DR(数据表示)检查事物的类型。对于 char-vec,它是 82(在 32 位解释器上)或 80(64 位)——由于 64 位平台支持 unicode,它也可以是 160 或 320。嵌套向量是 326。
⎕DR
注意:您还可以使用⎕DR¨来调查哪个元素与您预期的不符......
⎕DR¨
我在APL2。天真地我会去
X≡¨⍕¨X
数值为 1,字符值为 0。
像这样