APL 家族

APL dialects:

  • Dyalog APL, GNU APL, KAP

  • J, K, Q, BQN

J Primer

Primer Contents

  1. 七种词性(parts of speech): noun, verb, modifier(adverb, conjunction), copula, punctuation, control word

  2. ambivalence: monadic, dyadic

  3. rank: atom, list, table, array, axis, shape, rank, frame, cell, item, k-cell, agreement

  4. function train:

    • 2-train, hook(Dyalog 里定义为 atop,J 使用 @ 表示 atop)
    • 3-train, fork
  5. Function styles

    • Defined functions, traditional functions, tradfns, canonical form: 类似主流语言,有完整的函数签名,包括返回值、函数名、参数名、局部变量名。动态作用域。

    • Direct definitions, direct functions, dfns, formal form: 使用 ⍺ 和 ⍵ 或者 x 和 y 作为参数名,J 有两种,一种是使用 : 的 explicit definition,一种是使用 {{ ... }} 定义的 direct definition,其它 APL 家族语言一般使用 { ... }。 词法作用域。

    • Anonymous functions:就是 direct definitions,不赋值给一个 name。

    • Tacit definition, tacit definition, point-free style: 省略参数,直接组合动词。