Tacit programming: Difference between revisions

Jump to navigation Jump to search
m
Fix code
Tags: Mobile edit Mobile web edit
m (Fix code)
 
(One intermediate revision by one other user not shown)
Line 21: Line 21:


       Dot ← +.×
       Dot ← +.×
       3 1 4 dot 2 7 1
       3 1 4 Dot 2 7 1
17
17
</syntaxhighlight>
</syntaxhighlight>
== Derived operators ==
== Derived operators ==
A dyadic operator with its right operand forms a tacit monadic operator:
A dyadic operator with its right operand forms a tacit monadic operator:
Line 196: Line 197:
666                          ⍝ the sum of the squares of the primes up to 17
666                          ⍝ the sum of the squares of the primes up to 17
</syntaxhighlight>
</syntaxhighlight>
Note that <syntaxhighlight lang=apl inline>((⊢⍨∘.×⍨)1↓⍳)</syntaxhighlight> is a train computing primes up to the given input.
Note that <syntaxhighlight lang=apl inline>((⊢~∘.×⍨)1↓⍳)</syntaxhighlight> is a train computing primes up to the given input.


A more satisfying variation of the accursed train is the following.
A more satisfying variation of the accursed train is the following.
1

edit

Navigation menu