JPhrases/Structural

From J Wiki
Jump to navigation Jump to search

5A. Structural

The verbs given here affect the structure of the arguments; the shape or rank of the result of such verbs differ from the shape or rank of the argument.

m0=: ,: Add leading dimension of length 1
m1=: ,:"_1 Add leading dim of length 1 to items
m2=: ,:"1 Add leading dim of length 1 to rows
m3=: ,:"0 Add leading dim of length 1 to scalars
m4=: ,. 1-column table from list
d5=:([:":[:,.[),"1(' '"_,"1 [:":]) Append row stub x to table y
m6=: ,:- Array and its negative
m7=: #:&.<:@# $ ] Make a hypercube from a vector of length n (where n is a power of 2)