Naming Conventions |
|||||
|
Scalar |
Vector |
Matrix |
Any |
Non- |
Boolean |
BS |
BV |
BM |
BA |
BN |
Integer |
IS |
IV |
IM |
IA |
IN |
Float |
FS |
FV |
FM |
FA |
FN |
Numeric |
NS |
NV |
NM |
NA |
NN |
Character |
CS |
CV |
CM |
CA |
CN |
Enclosed |
ES |
EV |
EM |
EA |
EN |
enclosed |
TS |
TV |
TM |
TA |
TN |
Simple |
SS |
SV |
SM |
SA |
SN |
Any |
AS |
AV |
AM |
AA |
AN |
phrase e.g.: .X...Y. ⍝ X←BS; Y←IV |
|||||
combinations: use ISV for Integer scalar∨vector |
|||||
B3, I4 &c. to specify higher ranks. |
|||||
IsCharacter
This phrase returns a Boolean 1 depending on the type of the simple, non-mixed array.
' '=↑1↑0⍴SA
Examples
⎕FX ⍕2 1⍴'r←IsCharacter y' 'r←'' ''=↑1↑0⍴y'
IsCharacter¨'a' 1
1 0
How not to do it!
In Dyalog, there is a system function ⎕DR available which returns the data type of its argument. Albeit being useful on any non-char types, there is no reason to use it in order to determine whether a simple, non-mixed array is of type Char or not. In the Unicode version of Dyalog ⎕DR started to return 80 for a character variable rather than 82. The phrase returns a 1 in both, the Classic and the Unicode version.
Compatibility
Checked with: APL2, APLX, Dyalog, NARS2000
Test Cases
Show test cases
Test my code, both Examples and Test Cases.
Mentor: KaiJaeger
Tags: <TypeCheck> <CheckType>
APL Wiki