Simple examples: Difference between revisions

Jump to navigation Jump to search
83 bytes added ,  05:49, 26 August 2020
m
(→‎Tacit programming: better explanation for the newbies)
(2 intermediate revisions by 2 users not shown)
Line 41: Line 41:
=== Tacit programming ===
=== Tacit programming ===


{{Main|Tacit}}
{{Main|Tacit programming}}


In APL’s tacit definition, no braces are needed to mark the definition of a function: primitive functions just combine in a way that enables us to omit any reference to the function arguments — hence ''tacit''. Here is the same calculation written tacitly:
In APL’s tacit definition, no braces are needed to mark the definition of a function: primitive functions just combine in a way that enables us to omit any reference to the function arguments — hence ''tacit''. Here is the same calculation written tacitly:
Line 54: Line 54:
|}
|}


Note that <source lang=apl inline>+⌿</source> is evaluated as a single derived function.
The general scheme for monadic 3-trains is the following:
The general scheme for monadic 3-trains is the following:
{|
{|
Line 59: Line 60:
|}
|}


But other types of trains are also possible. See [[Tacit programming#Trains|tacit programming]].
But other types of [[Tacit programming#Trains|trains]] are also possible.


==Text processing==
==Text processing==
Line 91: Line 92:
</source>
</source>
{{Works in|[[Dyalog APL]]}}
{{Works in|[[Dyalog APL]]}}
Notice of you can read the [[tacit]] function <source lang=apl inline>≠⊆⊢</source> like an English sentence: ''The inequality partitions the right argument''.
Notice that you can read the [[tacit]] function <source lang=apl inline>≠⊆⊢</source> like an English sentence: ''The inequality partitions the right argument''.
 
=== Indices of multiple elements ===
=== Indices of multiple elements ===
<source lang=apl inline>∊</source> gives us a mask for elements (characters) in the left argument that are members of the right argument:
<source lang=apl inline>∊</source> gives us a mask for elements (characters) in the left argument that are members of the right argument:

Navigation menu