Defined function (traditional): Difference between revisions

Jump to navigation Jump to search
+example to show how optional left argument is used
(A+)
(+example to show how optional left argument is used)
Line 4: Line 4:


== Examples ==
== Examples ==
Example function with optional left argument and one local variable:
<source lang=apl>
∇ res←{left} AddMult2 right;local
  :If 0=⎕NC'left'
      left←0      ⍝ define variable "left" with value 0 if it's not defined already
  :EndIf
  local←left+right
  res←2×local
</source>


== Representations ==
== Representations ==
Line 27: Line 37:
===Tutorials===
===Tutorials===
* APL Cultivation: [https://chat.stackexchange.com/rooms/52405/conversation/lesson-31-tradfns tradfns]
* APL Cultivation: [https://chat.stackexchange.com/rooms/52405/conversation/lesson-31-tradfns tradfns]
* Bernard Legrand. [https://www.dyalog.com/uploads/documents/MasteringDyalogAPL.pdf#page=176 Mastering Dyalog APL (page 176)]. [[Dyalog Ltd]]. November 2009.


=== Documentation ===
=== Documentation ===
trusted
69

edits

Navigation menu