System Function FMT: Difference between revisions

From NARS2000
Jump to navigationJump to search
No edit summary
Line 32: Line 32:
└~────┘<br />
└~────┘<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕fmt ⍳¨⍳3<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕fmt ⍳¨⍳3<br />
┌3────────────────────┐<br />
┌3──────────────────┐<br />
│ ┌1┐ &nbsp;┌2──┐ &nbsp;┌3────┐ │<br />
│ ┌1┐&nbsp;┌2──┐&nbsp;┌3────┐ │<br />
│ │1│ &nbsp;│1 2│ &nbsp;│1 2 3│ │<br />
│ │1│&nbsp;│1 2│&nbsp;│1 2 3│ │<br />
│ └~┘ &nbsp;└~──┘ &nbsp;└~────┘ 2<br />
│ └~┘&nbsp;└~──┘&nbsp;└~────┘ 2<br />
└∊────────────────────┘<br />
└∊──────────────────┘<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕fmt 1 1 4⍴23 'abc' '*' (2 3⍴⍳6)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕fmt 1 1 4⍴23 'abc' '*' (2 3⍴⍳6)<br />
┌┬4───────────────────────┐<br />
┌┬4────────────────────┐<br />
11 &nbsp;&nbsp;&nbsp;&nbsp;┌3──┐ &nbsp;&nbsp;&nbsp;&nbsp;┌3─────┐ │<br />
11 &nbsp;&nbsp;&nbsp;┌3──┐&nbsp;&nbsp;&nbsp;┌3─────┐ │<br />
││ 23 &nbsp;│abc│ &nbsp;* &nbsp;2 1 2 3│ │<br />
││ 23&nbsp;│abc│&nbsp;*&nbsp;2 1 2 3│ │<br />
││ ~~ &nbsp;└───┘ &nbsp;¯ &nbsp;│ 4 5 6│ │<br />
││ ~~&nbsp;└───┘&nbsp;¯&nbsp;│ 4 5 6│ │<br />
││ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└~─────┘ 2<br />
││ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└~─────┘ 2<br />
└┴∊───────────────────────┘<br />
└┴∊────────────────────┘<br />
</apll>
</apll>



Revision as of 00:51, 6 May 2009

Monadic Function

Z←⎕FMT R returns a representation of R formatted within boxes.
R is an arbitrary array.
Z is a character matrix which reveals the array structure and types of the elements of R.


For example,

      ⎕fmt ⍳3
┌3────┐
│1 2 3│
└~────┘
      ⎕fmt ⍳¨⍳3
┌3──────────────────┐
│ ┌1┐ ┌2──┐ ┌3────┐ │
│ │1│ │1 2│ │1 2 3│ │
│ └~┘ └~──┘ └~────┘ 2
└∊──────────────────┘
      ⎕fmt 1 1 4⍴23 'abc' '*' (2 3⍴⍳6)
┌┬4────────────────────┐
11    ┌3──┐   ┌3─────┐ │
││ 23 │abc│ * 2 1 2 3│ │
││ ~~ └───┘ ¯ │ 4 5 6│ │
││            └~─────┘ 2
└┴∊────────────────────┘


This function is implemented via the Magic Functions #MonFMT and #Box.

Dyadic Function

Z←L ⎕FMT R returns the formatted representation of R as controlled by L.
R is a simple scalar, vector, or matrix, or it is a nested vector of simple vectors.
L is a character scalar or vector.


This function is not as yet implemented.