Template:APLFN5: Difference between revisions

From NARS2000
Jump to navigationJump to search
No edit summary
No edit summary
Line 9: Line 9:
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><apll>{</nowiki>{APLFN5|1=K{:=}Header arg1<br/>
|'Line1'<br/>
|2='Line1'<br/>
|X{:=}0<br/>
|3=X{:=}0<br/>
|rhoresult {:=} {rho} X<br/>
|4=rhoresult {:=} {rho} X<br/>
|{comment} one more line<br/>
|5={comment} one more line<br/>
|K {:=}1}}<br/>
|6-K {:=}1}}<nowiki></apll><br/>


Test 1
And you get:
<apll>{{APLFN5|1=K{:=}Header arg1<br/>
|2='Line1'<br/>
|3=X{:=}0<br/>
|4=rhoresult {:=} {rho} X<br/>
|5={comment} one more line<br/>
|6-K {:=}1}}</apll><br/>


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


Test 2
{{APLFN5
| K{:=}Header arg1
| 'Line1'
| X{:=}0
| rhoresult {:=} {rho} X
| {comment} one more line
| 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>

Revision as of 13:03, 27 February 2013

    ∇ {{{1}}}
[1]    {{{2}}}
[2]    {{{3}}}
[3]    {{{4}}}
[4]    {{{5}}}
[5]    {{{6}}}
    ∇

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:

<apll>{{APLFN5|1=K←Header arg1
|2='Line1'
|3=X←0
|4=rhoresult ← ⍴ X
|5=⍝ one more line
|6-K ←1}}<nowiki></apll>

And you get: {{APLFN5|1=K←Header arg1
|2='Line1'
|3=X←0
|4=rhoresult ← ⍴ X
|5=⍝ one more line
|6-K ←1}}