Template:APLFN5: Difference between revisions

From NARS2000
Jump to navigationJump to search
(new)
 
No edit summary
Line 1: Line 1:
<includeonly><code>&nbsp;&nbsp;&nbsp;&nbsp;{{delta}}{{{1}}}<br/>
<includeonly><apll><code>&nbsp;&nbsp;&nbsp;&nbsp;{delta}{{{{1}}}<br/>
[1]&nbsp;&nbsp;&nbsp;{{{2}}}<br/>
[1]&nbsp;&nbsp;&nbsp;{{{2}}}<br/>
[2]&nbsp;&nbsp;&nbsp;{{{3}}}<br/>
[2]&nbsp;&nbsp;&nbsp;{{{3}}}<br/>
Line 5: Line 5:
[4]&nbsp;&nbsp;&nbsp;{{{5}}}<br/>
[4]&nbsp;&nbsp;&nbsp;{{{5}}}<br/>
[5]&nbsp;&nbsp;&nbsp;{{{6}}}<br/>
[5]&nbsp;&nbsp;&nbsp;{{{6}}}<br/>
&nbsp;&nbsp;&nbsp;&nbsp;∇ </code><br/></includeonly><noinclude>
&nbsp;&nbsp;&nbsp;&nbsp;∇ </code><br/></apll></includeonly><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.


Line 18: Line 18:


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

Revision as of 08:57, 27 February 2013

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. Like this:

{{APLFN5|K←Header arg1
|'Line1'
|X←0
|rhoresult ← ⍴ X
|⍝ one more line
|K ←1}}

And you get:
    ∇ K←Header arg1
[1]   'Line1'
[2]   X←0
[3]   rhoresult ← ⍴ X
[4]   ⍝ one more line
[5]   K ←1}}
    ∇