Klong: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Infobox array language | array model = Lists | index origin = 0 | function styles = dfn-style | numeric types...") |
No edit summary |
||
Line 26: | Line 26: | ||
! Operator !! Monadic !! Dyadic | ! Operator !! Monadic !! Dyadic | ||
|- | |- | ||
| < | | <code>+</code> || [[Transpose]] || [[Plus]] | ||
|- | |- | ||
| < | | <code>-</code> || [[Negate]] || [[Minus]] | ||
|- | |- | ||
| < | | <code>*</code> || [[First]] || [[Times]] | ||
|- | |- | ||
| < | | <code>%</code> || [[Reciprocal]] || [[Divide]] | ||
|- | |- | ||
| < | | <code>:%</code> || || Integer-Divide | ||
|- | |- | ||
| < | | <code><nowiki>|</nowiki></code> || [[Reverse]] || [[Max]]/[[Or]] | ||
|- | |- | ||
| < | | <code>:+</code> || || [[Rotate]] | ||
|- | |- | ||
| < | | <code>&</code> || [[Expand]]/[[Where]] || [[Min]]/[[And]] | ||
|- | |- | ||
| < | | <code>^</code> || [[Shape]] || [[Power]] | ||
|- | |- | ||
| < | | <code>:^</code> || || [[Reshape]] | ||
|- | |- | ||
| < | | <code>!</code> || [[Iota|Enumerate]] || [[Remainder]] | ||
|- | |- | ||
| < | | <code><</code> || [[Grade-Up]] || [[Less]] | ||
|- | |- | ||
| < | | <code>></code> || [[Grade-Down]] || [[More]] | ||
|- | |- | ||
| < | | <code>=</code> || [[Group]] || [[Equal]] | ||
|- | |- | ||
| < | | <code>~</code> || [[Not]] || [[Match]] | ||
|- | |- | ||
| < | | <code>@</code> || [[Atom]] || [[Index function|Index]]/Apply | ||
|- | |- | ||
| < | | <code>:@</code> || || Index-in-Depth | ||
|- | |- | ||
| < | | <code>?</code> || [[Range]] || [[Find]] | ||
|- | |- | ||
| < | | <code>,</code> || List (like [[Enclose]]) || [[Join]] | ||
|- | |- | ||
| < | | <code>_</code> || [[Floor]] || [[Drop]] | ||
|- | |- | ||
| < | | <code>:_</code> || Undefined || [[Cut (K)|Cut]] | ||
|- | |- | ||
| < | | <code>:#</code> || Char || Split ([[Partition by lengths]]) | ||
|- | |- | ||
| < | | <code>#</code> || [[Tally|Size]] || [[Take]] | ||
|- | |- | ||
| < | | <code>$</code> || [[Format]] || [[Dyadic format|Format2]] | ||
|- | |- | ||
| < | | <code>:=</code> || || [[Amend]] | ||
|- | |- | ||
| < | | <code>:-</code> || || Amend-in-Depth | ||
|- | |- | ||
| < | | <code>::</code> || || Define | ||
|- | |- | ||
| < | | <code>:$</code> || || Form | ||
|} | |} | ||
Line 86: | Line 86: | ||
! Adverb !! Definition | ! Adverb !! Definition | ||
|- | |- | ||
| < | | <code> f'a</code> || [[Each]] | ||
|- | |- | ||
| < | | <code>a f'b</code> || Each2 | ||
|- | |- | ||
| < | | <code>a f:\b</code> || Each-Left | ||
|- | |- | ||
| < | | <code>a f:/b</code> || Each-Right | ||
|- | |- | ||
| < | | <code> f:'b</code> || Each-Pair | ||
|- | |- | ||
| < | | <code> f/a</code> || Over | ||
|- | |- | ||
| < | | <code>a f/b</code> || Over-Neutral | ||
|- | |- | ||
| < | | <code> f:~a</code> || Converge | ||
|- | |- | ||
| < | | <code>a f:~b</code> || While | ||
|- | |- | ||
| < | | <code>a f:*b</code> || Iterate | ||
|- | |- | ||
| < | | <code> f\a</code> || Scan-Over | ||
|- | |- | ||
| < | | <code>a f\b</code> || Scan-Over-Neutral | ||
|- | |- | ||
| < | | <code> f\~a</code> || Scan-Converging | ||
|- | |- | ||
| < | | <code>a f\~a</code> || Scan-While | ||
|- | |- | ||
| < | | <code>a f\*a</code> || Scan-Iterating | ||
|} | |} | ||
Revision as of 14:43, 16 March 2020
Klong is a language based on K (probably K3) which removes K's syntactic ambiguity and much of its overloading by using more digraphs (primitives composed of two characters) to separate extra meanings. The removal of syntactic ambiguity means Klong has a context-free grammar.
Primitives
Klong documentation refers to primitive functions ("verbs" in K) as "operators".
Operator | Monadic | Dyadic |
---|---|---|
+ |
Transpose | Plus |
- |
Negate | Minus |
* |
First | Times |
% |
Reciprocal | Divide |
:% |
Integer-Divide | |
| |
Reverse | Max/Or |
:+ |
Rotate | |
& |
Expand/Where | Min/And |
^ |
Shape | Power |
:^ |
Reshape | |
! |
Enumerate | Remainder |
< |
Grade-Up | Less |
> |
Grade-Down | More |
= |
Group | Equal |
~ |
Not | Match |
@ |
Atom | Index/Apply |
:@ |
Index-in-Depth | |
? |
Range | Find |
, |
List (like Enclose) | Join |
_ |
Floor | Drop |
:_ |
Undefined | Cut |
:# |
Char | Split (Partition by lengths) |
# |
Size | Take |
$ |
Format | Format2 |
:= |
Amend | |
:- |
Amend-in-Depth | |
:: |
Define | |
:$ |
Form |
Adverb | Definition |
---|---|
f'a |
Each |
a f'b |
Each2 |
a f:\b |
Each-Left |
a f:/b |
Each-Right |
f:'b |
Each-Pair |
f/a |
Over |
a f/b |
Over-Neutral |
f:~a |
Converge |
a f:~b |
While |
a f:*b |
Iterate |
f\a |
Scan-Over |
a f\b |
Scan-Over-Neutral |
f\~a |
Scan-Converging |
a f\~a |
Scan-While |
a f\*a |
Scan-Iterating |
External links
APL dialects [edit] | |
---|---|
Maintained | APL+Win ∙ APL2 ∙ APL64 ∙ APL\iv ∙ Aplette ∙ April ∙ Co-dfns ∙ Dyalog APL ∙ Dyalog APL Vision ∙ dzaima/APL ∙ GNU APL ∙ Kap ∙ NARS2000 ∙ Pometo ∙ TinyAPL |
Historical | A Programming Language ∙ A+ (A) ∙ APL# ∙ APL2C ∙ APL\360 ∙ APL/700 ∙ APL\1130 ∙ APL\3000 ∙ APL.68000 ∙ APL*PLUS ∙ APL.jl ∙ APL.SV ∙ APLX ∙ Extended Dyalog APL ∙ Iverson notation ∙ IVSYS/7090 ∙ NARS ∙ ngn/apl ∙ openAPL ∙ Operators and Functions ∙ PAT ∙ Rowan ∙ SAX ∙ SHARP APL ∙ Rationalized APL ∙ VisualAPL (APLNext) ∙ VS APL ∙ York APL |
Derivatives | AHPL ∙ BQN ∙ CoSy ∙ ELI ∙ Glee ∙ I ∙ Ivy ∙ J ∙ Jelly ∙ K (Goal, Klong, Q) ∙ KamilaLisp ∙ Lang5 ∙ Lil ∙ Nial ∙ RAD ∙ Uiua |
Overviews | Comparison of APL dialects ∙ Timeline of array languages ∙ Timeline of influential array languages ∙ Family tree of array languages |