APL Wiki:About: Difference between revisions

Jump to navigation Jump to search
517 bytes added ,  07:44, 31 October 2019
Miraheze>Adám Brudzewsky
Miraheze>Adám Brudzewsky
Line 12: Line 12:
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Starting_a_new_page Starting a new page]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Starting_a_new_page Starting a new page]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Links Links]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Links Links]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Formatting Formatting], however, when including APL code in a page, please follow the below guidelines.
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Formatting Formatting], but please follow the below guidelines.


=== Inline APL code ===
=== Inline APL code ===


Inline APL code should use the format
Inline code is used for single primitives and short expressions and uses the format
 
<blockquote><pre>The formula <source lang=apl inline>(2=+⌿0=N∘.|N)/N←⍳100</source> computes primes.</pre></blockquote>
<blockquote><pre>The formula <source lang=apl inline>(2=+⌿0=N∘.|N)/N←⍳100</source> computes primes.</pre></blockquote>
which results in
which results in
Line 23: Line 24:
=== APL code blocks ===
=== APL code blocks ===


Inline APL code should use the format
For session transcripts, function definitions and lorger expressions, use code blocks like
 
<blockquote><pre>The formula
<blockquote><pre>The formula
<source lang=apl>(2=+⌿0=N∘.|N)/N←⍳100</source>
 
<source lang=apl>
(2=+⌿0=N∘.|N)/N←⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
 
computes primes.</pre></blockquote>
computes primes.</pre></blockquote>
which results in
which results in
<blockquote>The formula <source lang=apl>(2=+⌿0=N∘.|N)/N←⍳100</source> computes primes.</blockquote>


Optionally, you can indicate one or more APL dialects which are able to run the code:
<blockquote>The formula
 
<source lang=apl>
      (2=+⌿0=N∘.|N)/N←⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
 
computes primes.</blockquote>
 
 
Optionally, you can indicate one or more APL dialects which are able to run the code by using a special template immediately after the source tag, like
 
<blockquote><pre>The formula
<blockquote><pre>The formula
<source lang=apl>{(2=+⌿0=⍵∘.|⍵)/⍵}⍳100</source>
 
<source lang=apl>
      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/APL]]}}
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/APL]]}}
computes primes.</pre></blockquote>
computes primes.</pre></blockquote>
which results in
which results in
<blockquote>The formula
<blockquote>The formula
<source lang=apl>{(2=+⌿0=⍵∘.|⍵)/⍵}⍳100</source>
 
<source lang=apl>
      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/APL]]}}
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/APL]]}}
computes primes.</blockquote>
computes primes.</blockquote>


You can include a link to [[TryAPL]] or [[Try It Online]] with
You can also include a link to [[TryAPL]] or [[Try It Online]] right before the source tag, for example
 
<blockquote><pre>The formula
<blockquote><pre>The formula
[https://tryapl.org/?a=%7B%282%3D+%u233F0%3D%u2375%u2218.%7C%u2375%29/%u2375%7D%u2373100&run Try it now!]
[https://tryapl.org/?a=%7B%282%3D+%u233F0%3D%u2375%u2218.%7C%u2375%29/%u2375%7D%u2373100&run Try it now!]
<source lang=apl>{(2=+⌿0=⍵∘.|⍵)/⍵}⍳100</source>
<source lang=apl>
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/APL]]}}
      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
 
computes primes.</pre></blockquote>
computes primes.</pre></blockquote>
which results in:
which results in:
<blockquote>The formula
<blockquote>The formula
[https://tryapl.org/?a=%7B%282%3D+%u233F0%3D%u2375%u2218.%7C%u2375%29/%u2375%7D%u2373100&run Try it now!]
[https://tryapl.org/?a=%7B%282%3D+%u233F0%3D%u2375%u2218.%7C%u2375%29/%u2375%7D%u2373100&run Try it now!]
<source lang=apl>{(2=+⌿0=⍵∘.|⍵)/⍵}⍳100</source>
<source lang=apl>
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/APL]]}}
      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
 
computes primes.</blockquote>
computes primes.</blockquote>


{{APL community}}
{{APL community}}

Navigation menu