4,494
edits
(Created page with "{{Built-in|Constant|⍨}} is a monadic operator which takes an array as its operand and becomes a function which returns the operand array regardless of its ...") |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Built-in|Constant|⍨}} is a [[monadic operator]] which takes an [[array]] as its [[operand]] and becomes a [[function]] which returns the operand array regardless of its [[argument|arguments]]. It was first introduced in [[Extended Dyalog APL]], and was adopted in [[Dyalog APL 18.0]] as an alternative to the constant [[dfn]] such as <source lang=apl inline>{0}</source>. | {{Built-in|Constant|⍨}} is a [[monadic operator]] which takes an [[array]] as its [[operand]] and becomes a [[function]] which returns the operand array regardless of its [[argument|arguments]]. It was first introduced in [[Extended Dyalog APL]], sharing its [[glyph]] with [[Commute]], and was adopted in [[Dyalog APL 18.0]] as an alternative to the constant [[dfn]] such as <source lang=apl inline>{0}</source>. | ||
== Examples == | == Examples == | ||
Line 15: | Line 15: | ||
f2←*∘3+ ⍝ A workaround using Bind; ditto | f2←*∘3+ ⍝ A workaround using Bind; ditto | ||
f3←+*{3} ⍝ A workaround using a constant dfn | f3←+*{3} ⍝ A workaround using a constant dfn | ||
f4←+*3⊣⊢ ⍝ A workaround using Identity | |||
f5←+*3⍨ ⍝ A solution using Constant | |||
</source>{{Works in|[[Extended Dyalog APL]], [[Dyalog APL 18.0]]}} | </source>{{Works in|[[Extended Dyalog APL]], [[Dyalog APL 18.0]]}} | ||