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 | <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] Z←(∊((⊂[1]'LO< ∇>P<[>Q<]>I6' ⎕fmt ⍳⍴Z),¨Z),¨⊂⎕TCNL,⎕TCLF),' ∇'<br /> | [5] Z←(∊((⊂[1]'LO< ∇>P<[>Q<]>I6' ⎕fmt ⍳⍴Z),¨Z),¨⊂⎕TCNL,⎕TCLF),' ∇'<br /> | ||
∇<br /> | ∇<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> f←+.×<br /> | |||
⍴⎕←⎕vr 'f'<br /> | |||
+.×<br /> | |||
3<br /> | |||
</apll> | </apll> |
Revision as of 13:17, 8 May 2009
|
||||
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