Klong: Difference between revisions

From APL Wiki
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
|-
|-
| <source lang=k inline>+</source>  || [[Transpose]]          || [[Plus]]
| <code>+</code>  || [[Transpose]]          || [[Plus]]
|-
|-
| <source lang=k inline>-</source>  || [[Negate]]              || [[Minus]]
| <code>-</code>  || [[Negate]]              || [[Minus]]
|-
|-
| <source lang=k inline>*</source>  || [[First]]              || [[Times]]
| <code>*</code>  || [[First]]              || [[Times]]
|-
|-
| <source lang=k inline>%</source>  || [[Reciprocal]]          || [[Divide]]
| <code>%</code>  || [[Reciprocal]]          || [[Divide]]
|-
|-
| <source lang=k inline>:%</source> ||                        || Integer-Divide
| <code>:%</code> ||                        || Integer-Divide
|-
|-
| <source lang=k inline>|</source>  || [[Reverse]]            || [[Max]]/[[Or]]
| <code><nowiki>|</nowiki></code>  || [[Reverse]]            || [[Max]]/[[Or]]
|-
|-
| <source lang=k inline>:+</source> ||                        || [[Rotate]]
| <code>:+</code> ||                        || [[Rotate]]
|-
|-
| <source lang=k inline>&</source>  || [[Expand]]/[[Where]]    || [[Min]]/[[And]]
| <code>&</code>  || [[Expand]]/[[Where]]    || [[Min]]/[[And]]
|-
|-
| <source lang=k inline>^</source>  || [[Shape]]              || [[Power]]
| <code>^</code>  || [[Shape]]              || [[Power]]
|-
|-
| <source lang=k inline>:^</source> ||                        || [[Reshape]]
| <code>:^</code> ||                        || [[Reshape]]
|-
|-
| <source lang=k inline>!</source>  || [[Iota|Enumerate]]      || [[Remainder]]
| <code>!</code>  || [[Iota|Enumerate]]      || [[Remainder]]
|-
|-
| <source lang=k inline><</source>  || [[Grade-Up]]            || [[Less]]
| <code><</code>  || [[Grade-Up]]            || [[Less]]
|-
|-
| <source lang=k inline>></source>  || [[Grade-Down]]          || [[More]]
| <code>></code>  || [[Grade-Down]]          || [[More]]
|-
|-
| <source lang=k inline>=</source>  || [[Group]]              || [[Equal]]
| <code>=</code>  || [[Group]]              || [[Equal]]
|-
|-
| <source lang=k inline>~</source>  || [[Not]]                || [[Match]]
| <code>~</code>  || [[Not]]                || [[Match]]
|-
|-
| <source lang=k inline>@</source>  || [[Atom]]                || [[Index function|Index]]/Apply
| <code>@</code>  || [[Atom]]                || [[Index function|Index]]/Apply
|-
|-
| <source lang=k inline>:@</source> ||                        || Index-in-Depth
| <code>:@</code> ||                        || Index-in-Depth
|-
|-
| <source lang=k inline>?</source>  || [[Range]]              || [[Find]]
| <code>?</code>  || [[Range]]              || [[Find]]
|-
|-
| <source lang=k inline>,</source>  || List (like [[Enclose]]) || [[Join]]
| <code>,</code>  || List (like [[Enclose]]) || [[Join]]
|-
|-
| <source lang=k inline>_</source>  || [[Floor]]              || [[Drop]]
| <code>_</code>  || [[Floor]]              || [[Drop]]
|-
|-
| <source lang=k inline>:_</source> || Undefined              || [[Cut (K)|Cut]]
| <code>:_</code> || Undefined              || [[Cut (K)|Cut]]
|-
|-
| <source lang=k inline>:#</source> || Char                    || Split ([[Partition by lengths]])
| <code>:#</code> || Char                    || Split ([[Partition by lengths]])
|-
|-
| <source lang=k inline>#</source>  || [[Tally|Size]]          || [[Take]]
| <code>#</code>  || [[Tally|Size]]          || [[Take]]
|-
|-
| <source lang=k inline>$</source>  || [[Format]]              || [[Dyadic format|Format2]]
| <code>$</code>  || [[Format]]              || [[Dyadic format|Format2]]
|-
|-
| <source lang=k inline>:=</source> ||                        || [[Amend]]
| <code>:=</code> ||                        || [[Amend]]
|-
|-
| <source lang=k inline>:-</source> ||                        || Amend-in-Depth
| <code>:-</code> ||                        || Amend-in-Depth
|-
|-
| <source lang=k inline>::</source> ||                        || Define
| <code>::</code> ||                        || Define
|-
|-
| <source lang=k inline>:$</source> ||                        || Form
| <code>:$</code> ||                        || Form
|}
|}


Line 86: Line 86:
! Adverb                                !! Definition
! Adverb                                !! Definition
|-
|-
| <source lang=k inline>  f'a</source>  || [[Each]]
| <code>  f'a</code>  || [[Each]]
|-
|-
| <source lang=k inline>a f'b</source>  || Each2
| <code>a f'b</code>  || Each2
|-
|-
| <source lang=k inline>a f:\b</source> || Each-Left
| <code>a f:\b</code> || Each-Left
|-
|-
| <source lang=k inline>a f:/b</source> || Each-Right
| <code>a f:/b</code> || Each-Right
|-
|-
| <source lang=k inline>  f:'b</source> || Each-Pair
| <code>  f:'b</code> || Each-Pair
|-
|-
| <source lang=k inline>  f/a</source>  || Over
| <code>  f/a</code>  || Over
|-
|-
| <source lang=k inline>a f/b</source>  || Over-Neutral
| <code>a f/b</code>  || Over-Neutral
|-
|-
| <source lang=k inline>  f:~a</source> || Converge
| <code>  f:~a</code> || Converge
|-
|-
| <source lang=k inline>a f:~b</source> || While
| <code>a f:~b</code> || While
|-
|-
| <source lang=k inline>a f:*b</source> || Iterate
| <code>a f:*b</code> || Iterate
|-
|-
| <source lang=k inline>  f\a</source>  || Scan-Over
| <code>  f\a</code>  || Scan-Over
|-
|-
| <source lang=k inline>a f\b</source>  || Scan-Over-Neutral
| <code>a f\b</code>  || Scan-Over-Neutral
|-
|-
| <source lang=k inline>  f\~a</source> || Scan-Converging
| <code>  f\~a</code> || Scan-Converging
|-
|-
| <source lang=k inline>a f\~a</source> || Scan-While
| <code>a f\~a</code> || Scan-While
|-
|-
| <source lang=k inline>a f\*a</source> || Scan-Iterating
| <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+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000Pometo
Historical A Programming LanguageA+ (A) ∙ APL#APL2CAPL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXExtended Dyalog APLIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyK (Goal, Klong, Q) ∙ KamilaLispLang5LilNialRADUiua
Overviews Comparison of APL dialectsTimeline of array languagesTimeline of influential array languagesFamily tree of array languages