System Function VR: Difference between revisions

From NARS2000
Jump to navigationJump to search
(New page: <table border="1" cellpadding="5" cellspacing="0" rules="none" summary=""> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" summary=""> <tr> <td valign="top"><ap...)
 
No edit summary
Line 22: Line 22:
<br />
<br />


<p>This system function is implemented as a internal Magic Function.</p>
<p>This function is implemented via the Magic Function <apll>#MonVR</apll>.</p>


<p>For example,</p>
<p>For example,</p>
Line 34: Line 34:
[5]&nbsp;&nbsp;&nbsp;Z←(∊((⊂[1]'LO<&nbsp;&nbsp;&nbsp;&nbsp;∇>P<[>Q<]>I6' ⎕fmt ⍳⍴Z),¨Z),¨⊂⎕TCNL,⎕TCLF),'&nbsp;&nbsp;&nbsp;&nbsp;∇'<br />
[5]&nbsp;&nbsp;&nbsp;Z←(∊((⊂[1]'LO<&nbsp;&nbsp;&nbsp;&nbsp;∇>P<[>Q<]>I6' ⎕fmt ⍳⍴Z),¨Z),¨⊂⎕TCNL,⎕TCLF),'&nbsp;&nbsp;&nbsp;&nbsp;∇'<br />
&nbsp;&nbsp;&nbsp;&nbsp;∇<br />
&nbsp;&nbsp;&nbsp;&nbsp;∇<br />
</apll>
<p>If the function named in <apll>R</apll> is directly assigned, the result is the character vector representation of that function (see line 4 above), as in</p>
<apll>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f←+.×<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⍴⎕←⎕vr 'f'<br />
+.×<br />
3<br />
</apll>
</apll>

Revision as of 18:17, 8 May 2009

Z←⎕VR R returns the visual representation of the user-defined function or operator named in R.
R is a character scalar or vector.
Z is a character vector representation of the user-defined function/operator.


This function is implemented via the Magic Function #MonVR.

For example,

      ⎕VR '#MonVR'
    ∇ Z←#MonVR R;⎕io
[1]   ⎕io←0
[2]   Z←1 ⎕cr R
[3]   →(0≠⍴Z)/L1 ⋄ Z←'' ⋄ →0
[4]   L1:→(1=≡Z)/0
[5]   Z←(∊((⊂[1]'LO<    ∇>P<[>Q<]>I6' ⎕fmt ⍳⍴Z),¨Z),¨⊂⎕TCNL,⎕TCLF),'    ∇'
    ∇

If the function named in R is directly assigned, the result is the character vector representation of that function (see line 4 above), as in

      f←+.×
      ⍴⎕←⎕vr 'f'
+.×
3