2,951
edits
(Created page with "{{Infobox array language | array model = Lists | index origin = 0 | function styles = dfn-style | numeric types...") |
(→Primitives: Fix some links) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 17: | Line 17: | ||
| influenced by = [[K]], [[wikipedia:Lisp (programming language)|Lisp]] | | influenced by = [[K]], [[wikipedia:Lisp (programming language)|Lisp]] | ||
}} | }} | ||
'''Klong''' is a language based on [[K]] (probably K3) which removes K's syntactic ambiguity and much of its overloading by using more digraphs ([[ | '''Klong''' is a language based on [[K]] (probably K3) which removes K's syntactic ambiguity and much of its overloading by using more digraphs ([[primitive function]]s and [[primitive operator|operators]] composed of two characters) to separate extra meanings. The removal of syntactic ambiguity means Klong has a [[wikipedia:context-free grammar|context-free grammar]]. | ||
== Primitives == | == Primitives == | ||
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 ([[Unique]]) || [[Find]] | ||
|- | |- | ||
| < | | <code>,</code> || List (like [[Enclose]]) || Join (like [[Catenate]]) | ||
|- | |- | ||
| < | | <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 | ||
|} | |} | ||
Line 122: | Line 122: | ||
* [http://t3x.org/klong/klong-vs-k.txt.html Differences from K] | * [http://t3x.org/klong/klong-vs-k.txt.html Differences from K] | ||
{{APL dialects}} | {{APL dialects}}[[Category:K dialects]] |