Template:APLFN5: Difference between revisions

From NARS2000
Jump to navigationJump to search
No edit summary
No edit summary
 
(17 intermediate revisions by one other user not shown)
Line 1: Line 1:
<apll><code>
<apll><pre>   {{{top}}}
&nbsp;&nbsp;&nbsp;&nbsp;∇ {{{1}}}<br/>
    ∇ {{{header}}}
[1]&nbsp;&nbsp;&nbsp; {{{2}}}<br/>
[1]   {{{1}}}
[2]&nbsp;&nbsp;&nbsp; {{{3}}}<br/>
[2]   {{{2}}}
[3]&nbsp;&nbsp;&nbsp; {{{4}}}<br/>
[3]   {{{3}}}
[4]&nbsp;&nbsp;&nbsp; {{{5}}}<br/>
[4]   {{{4}}}
[5]&nbsp;&nbsp;&nbsp; {{{6}}}<br/>
[5]   {{{5}}}
&nbsp;&nbsp;&nbsp;&nbsp;∇ </code><br/></apll>
&nbsp;&nbsp;&nbsp;&nbsp;∇</pre></apll>
<noinclude>
<noinclude>
This template is used to list an APL function having 5 lines. If this wiki adds the Parserfunction feature, this template will be replaced by a generic one.
This template is used to list an APL function having 5 lines. If this wiki adds the Parserfunction feature, this template will be replaced by a generic one.


This allows you to list the contents of a function without having to include the line numbers and the {delta} prefix and suffix. You just list the header and the 5 lines. Like this:
This allows you to list the contents of a function without having to include the line numbers and the {delta} prefix and suffix. You just list the header and the 5 lines. Because of the feature for translating apl symbols, you must specify the line values, Like this:


<nowiki>{</nowiki>{APLFN5|K{:=}Header arg1<br/>
<nowiki>{</nowiki>{APLFN5|top={quad}vr 'Header'<br/>
|'Line1'<br/>
|header=K{:=}Header arg1<br/>
|X{:=}0<br/>
|1='Line1'<br/>
|rhoresult {:=} {rho} X<br/>
|2=X{:=}0<br/>
|{comment} one more line<br/>
|3=rhoresult {:=} {rho} X<br/>
|K {:=}1}}<br/>
|4={comment} one more line<br/>
|5=K {:=}1
}}<br/>


Test 1
And you get:<br/>


{{APLFN5|1=K{:=}Header arg1
{{APLFN5|top={quad}vr 'Header'
|2='Line1'
|header=K{:=}Header arg1
|3=X{:=}0
|1='Line1'
|4= rhoresult {:=} {rho} X
|2=X{:=}0
|5= {comment} one more line
|3=rhoresult {:=} {rho} X
|6= K {:=}1 }}
|4={comment} one more line
|5=K {:=}1}}


And you get:<br/>
<code><apll>&nbsp;&nbsp;&nbsp;&nbsp;∇ K{:=}Header arg1<br/>
[1]&nbsp;&nbsp;&nbsp;'Line1'<br/>
[2]&nbsp;&nbsp;&nbsp;X{:=}0<br/>
[3]&nbsp;&nbsp;&nbsp;rhoresult {:=} {rho} X<br/>
[4]&nbsp;&nbsp;&nbsp;{comment} one more line<br/>
[5]&nbsp;&nbsp;&nbsp;K {:=}1<br/>
&nbsp;&nbsp;&nbsp;&nbsp;∇ </code></apll><br/>
</noinclude>
</noinclude>

Latest revision as of 04:32, 16 April 2018

    {{⊤}}
    ∇ {{{header}}}
[1]    {{{1}}}
[2]    {{{2}}}
[3]    {{{3}}}
[4]    {{{4}}}
[5]    {{{5}}}
    ∇

This template is used to list an APL function having 5 lines. If this wiki adds the Parserfunction feature, this template will be replaced by a generic one.

This allows you to list the contents of a function without having to include the line numbers and the ∆ prefix and suffix. You just list the header and the 5 lines. Because of the feature for translating apl symbols, you must specify the line values, Like this:

{{APLFN5|top=⎕vr 'Header'
|header=K←Header arg1
|1='Line1'
|2=X←0
|3=rhoresult ← ⍴ X
|4=⍝ one more line
|5=K ←1 }}

And you get:

    {{⊤}}
    ∇ {{{header}}}
[1]    {{{1}}}
[2]    {{{2}}}
[3]    {{{3}}}
[4]    {{{4}}}
[5]    {{{5}}}
    ∇