# SHARP APL: Difference between revisions

SHARP APL running under DOSBox

SHARP APL was a standalone version of APL offered by I.P. Sharp Associates (IPSA), who had previously offered APL interpretation as a timesharing service. IPSA employed many notable APL designers including Ken Iverson, and SHARP APL was the source of many developments in flat array theory.

## Primitive functions

### Arithmetic

#### Scalar

All scalar functions have rank zero.

`+` Conjugate/Identity Addition
`-` Negate Subtraction
`×` Signum Multiplication
`÷` Reciprocal Division
`*` Exponential Power
`⍟` Natural Logarithm Base-⍺ Logarithm
`|` Magnitude Residue
`!` Factorial Out-Of/Combinations
`⌊` Floor Minimum
`⌈` Ceiling Maximum
`○` Pi Times Circle functions
`∧` And/Least Common Multiple (LCM)
`∨` Or/Greatest Common Divisor (GCD)
`⍲` Nand
`⍱` Nor
`~` Not See Miscellaneous
`?` Roll See Non-scalar

#### Non-scalar

`⌹` 2 Matrix inverse ∞ 2 Matrix divide
`?` See Scalar * * Deal
`⊤` ∞ ∞ Encode
`⊥` ∞ ∞ Decode

### Relational

`=` See Miscellaneous 0 0 Equals
`≠` See Miscellaneous 0 0 Not Equals
`<` See Structural 0 0 Less Than
`≤` 0 0 Less Than or Equal
`≥` 0 0 Greater Than or Equal
`>` See Structural 0 0 Greater Than
`≡` ∞ ∞ Match
`∊` 0 ∞ Membership
`⍷` ∞ ∞ Find

### Indexing

`@` See Miscellaneous 0 ∞ From
`⍳` 1 Count 1 0 Index Of
`⍸` ∞ ∞ Index
`⍋` Numeric Grade up ∞ ∞ Character Grade up
`⍒` Numeric Grade down ∞ ∞ Character Grade down

### Structural

`⍴` Shape of 1 ∞ Reshape
`↑` See Miscellaneous 1 ∞ Take
`↓` Raze 1 ∞ Drop
`<` Enclose/Box See Relational
`⊃` Conditional Enclose ∞ ∞ Link
`>` 0 Disclose/Open See Relational
`,` Ravel ∞ ∞ Catenate
`⍪` Table ∞ ∞ Catenate-Down
`⌽` 1 Reverse 0 1 Rotate
`⊖` Reverse-Down ∞ ∞ Rotate-Down
`⍉` Monadic Transpose 0 ∞ Dyadic Transpose

### Miscellaneous

`⊣` Stop ∞ ∞ Left
`⊢` Pass ∞ ∞ Right
`≠` Nubsieve See Relational
`↑` Nub See Structural
`=` Nubin See Relational
`~` See Scalar ∞ ∞ Less
`@` 1 All See Indexing
`⍕` Monadic Format * ∞ Dyadic Format
`⍎` * Execute

## Primitive Operators

`/` `f` `∞` Reduce
`⌿` `f` `∞` Reduce-down
`\` `f` `∞` Scan
`⍀` `f` `∞` Scan-down
`/` `m` `∞` Copy/Compress
`⌿` `m` `∞` Copy-down/Compress-down
`\` `m` `∞` Expand
`⍀` `m` `∞` Expand-down
`⊂` `f` `∞` `rf lf` Swap
`&` `f` `∞` `∞ ∞` Select
`⍤` `f` `g` `mg` `mg mg` On (close Over)
`⍤` `f` `n` `n` `n n` Rank
`⍤` `m` `g` `mg` `mg mg` Cut
`⍥` `f` `g` `mg` `mg mg` Upon (close Atop)
`¨` `f` `g` `mg` `mg mg` Under
`¨` `m` `g` `mg` With (Bind)
`¨` `f` `n` `mf`
`.` `f` `g` `2` `∞ ∞` Alternant Inner-product
`.` `m` `g` `∞ ∞` Tie, Outer-product
`.` `f` `m` `mf` Ply

## Implementation

### Numeric types

SHARP originally supported only real numbers using double (8-byte) precision. Numbers were stored in one of three types:

• Boolean, with one bit per value
• Integer, with four bytes per value
• Floating, with eight bytes per value

SATN-40 describes the addition of complex numbers to SHARP APL.