Symbol Reduce

From NARS2000
(Redirected from /)
Jump to navigationJump to search

/ — Reduce/compress/replicate Operator — Keystroke / — Character 93 or x5D

Note: The APL name of this symbol is compress or {compress}, not reduce, however, reduce or reduction is the usual name for this symbol, but compress is one of the functions.

This symbol performs several different operations depending on whether it is combined with certain other operators

Functions

  • L / R compress or replicate R according to value in L
  • f/ R reduce operator f on each argument in R

Compress / Replicate

The argument on the left selects the elements on the right to discard, keep, or copy. For each element on the right there is a numeric value on the left indicating how many copies of that element on the right to keep. The number of elements must match. If the number is 0, that element is dropped. If 1, it is kept. If >1, it is copied that many times.

Usage

     1 1 0 0 0 0 0 0 0 0 0 0 1 1 / 'Taste the cake'
Take
     2 1 0 0 0 0 0 0 0 0 0 0 1 1 / 'Taste the cake'
TTake
     1 1 1 0 / 'take' 'this' 'drop' 'that'
take  this drop
     1 1 1 1 / 'take' 'this' 'drop' 'that'
take  this drop that
     1 0 1 1 / 'take' 'this' 'drop' 'that'
take  drop that
     0 1 1 0 / 'take' 'this' 'drop' 'that'
this  drop
     1 0 0 1 1/ 1 2 3 4 5
1 4 5
     1 2 3 4 5 / 1 2 3 4 5
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

Reduce

The operator to the left of the reduce operator is applied to the values to the right. These operators include

  • !/ Factorial reduce
  • -/ Minus reduce
  • +/ Plus reduce
  • ×/ Times reduce
  • */ Star reduce
  • ⍟/ Log reduce
  • ○/ Jot reduce
  • ∨/ Or reduce
  • ∧/ And reduce
  • ⍱/ Nor reduce
  • ⍲/ Nand reduce
  • ⌈/ Maximum
  • ⌊/ Minimum
  • =/ Binary operators
  • ≠/
  • ≤/
  • </
  • >/
  • ≥/

Usage

Example

See Also

NARS 2000 Lang
Tool
Bar
+ - × ÷ * ! ? |
< = >
~ § π .. ,
/ \ ¨ .
_ ¯
Second Row i j k i j k l g p r v x