4,494
edits
(make svg flat) |
|||
Line 334: | Line 334: | ||
We can do in-place concatenations to add all the circle tags and the closing tag: | We can do in-place concatenations to add all the circle tags and the closing tag: | ||
<source lang=apl> | <source lang=apl> | ||
100↑svg,←∊circles | |||
<circle cx="0" cy="0" r="1"/><circle cx="0" cy="9" r="2"/><circle cx="0" cy="21" r="3"/><circle cx=" | |||
svg,←'</svg>' | svg,←'</svg>' | ||
</source> | </source> | ||
You may recognise the pattern here as [[wikipedia:augmented assignment|augmented assignment]] from C and related programming languages. APL allows you to use any function to modify values in-place. If you are not familiar with this, then just think of <source lang=apl inline>name,←value</source> as <source lang=apl inline>name←name,value</source> (but the pass-though value is whatever is on the right of the assignment arrow). | You may recognise the pattern here as [[wikipedia:augmented assignment|augmented assignment]] from C and related programming languages. APL allows you to use any function to modify values in-place. If you are not familiar with this, then just think of <source lang=apl inline>name,←value</source> as <source lang=apl inline>name←name,value</source> (but the pass-though value is whatever is on the right of the assignment arrow). |