Shape: Difference between revisions
No edit summary |
("Better category ordering, add redirects to categories, fix pseudo-adverb categories") |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{primitive|^x}} |
{{primitive|^x|in=k3, kona|not=k4, oK, ngn/k, k9}} |
||
⚫ | |||
⚫ | |||
Shape is available in k3 and kona, and not available in k4, oK, ngn/k, and k9. |
|||
^(0 1 2;"ab",`c) |
^(0 1 2;"ab",`c) |
||
2 3 |
2 3 |
||
Line 13: | Line 12: | ||
d[+4 3#1] |
d[+4 3#1] |
||
3 4 |
3 4 |
||
[[Category:Verbs]] |
|||
[[Category:Operator verbs]] |
|||
[[Category:Primitives]] |
Latest revision as of 06:42, 9 July 2022
Shape
^x
Supported in | k3, kona |
Not supported in | k4, oK, ngn/k, k9 |
shape is a primitive that returns the list of lengths along all axes of a uniform array. For ragged arrays it returns only as many items as there are levels of uniformity.
^(0 1 2;"ab",`c) 2 3 ^(0 1 2;"abcd") ,2
For rectangular arrays, it can be implemented as [1]:
d:-1_#:'*:\ d[+4 3#1] 3 4