Strand notation: Difference between revisions

Jump to navigation Jump to search
108 bytes added ,  17:32, 18 November 2019
no edit summary
Miraheze>Adám Brudzewsky
No edit summary
Miraheze>Adám Brudzewsky
No edit summary
Line 1: Line 1:
{| class=vertical-navbox style="float:right; font-size:500%; margin:0 1ex;"
|<code>1 2 3</code>
|}
'''Strand notation''', or '''stranding''', is the convention that multiple (more than one) arrays written next to each other are automatically combined into a [[vector]]. Stranding can make code easier to read by eliminating the need for punctuation when writing small arrays in APL. It can also cause frustration when programming if unrelated arrays are stranded together. This issue occurs when [[operator]]s are allowed to take array [[operand]]s, and can be resolved by inserting extra parentheses or [[identity function]]s into the expression.
'''Strand notation''', or '''stranding''', is the convention that multiple (more than one) arrays written next to each other are automatically combined into a [[vector]]. Stranding can make code easier to read by eliminating the need for punctuation when writing small arrays in APL. It can also cause frustration when programming if unrelated arrays are stranded together. This issue occurs when [[operator]]s are allowed to take array [[operand]]s, and can be resolved by inserting extra parentheses or [[identity function]]s into the expression.


Line 10: Line 13:
f⍣3 0.8
f⍣3 0.8
</source>
</source>
In a language which strands before function application, this expression is equivalent to the derived function <source lang=apl inline>f⍣(3,0.8)</source>. Not what was intended! The two numbers must be separated somehow, for instance with parentheses or a [[tack function]].
In a language which strands before function application, this expression is equivalent to the derived function <source lang=apl inline>f⍣(3,0.8)</source>. Not what was intended! The two numbers must be separated somehow, for instance with parentheses or a [[Identity|tack function]].
<source lang=apl>
<source lang=apl>
(f⍣3)0.8
(f⍣3)0.8

Navigation menu