4,493
edits
Tags: Mobile edit Mobile web edit |
Tags: Mobile edit Mobile web edit |
||
Line 221: | Line 221: | ||
</source> | </source> | ||
=== Our first function === | === Our first function === | ||
In the most basic form, a [[dfn]] ("dee fun") is just an expression in curly braces with <source lang=apl inline>⍺</source> and <source lang=apl inline>⍵</source> representing the left and right arguments, just like they are the leftmost and rightmost letters of the [[wikipedia:Greek alphabet]]: | In the most basic form, a [[dfn]] ("dee fun") is just an expression in curly braces with <source lang=apl inline>⍺</source> and <source lang=apl inline>⍵</source> representing the left and right arguments, just like they are the leftmost and rightmost letters of the [[wikipedia:Greek alphabet|Greek alphabet]]: | ||
<source lang=apl> | <source lang=apl> | ||
Attr←{' ',⍺,'=',1⌽'""','¯'⎕R'-'⍕⍵} | Attr←{' ',⍺,'=',1⌽'""','¯'⎕R'-'⍕⍵} | ||
Line 234: | Line 234: | ||
└─────────┴─────────┘ | └─────────┴─────────┘ | ||
</source> | </source> | ||
=== Flattening enclosed things and enclosing flat things === | === Flattening enclosed things and enclosing flat things === | ||
Next, we make this list of strings (each of which is actually just a character list) into a simple list with the [[enlist]] function (<source lang=apl inline>∊</source>), and use above same concatenation and rotation techniques to finalise our tag: | Next, we make this list of strings (each of which is actually just a character list) into a simple list with the [[enlist]] function (<source lang=apl inline>∊</source>), and use above same concatenation and rotation techniques to finalise our tag: |