K: another rational redesign of APL

[top]

  1. Functional, array-oriented.
  2. Belongs to APL family, but uses plain-ASCII characters only.
  3. Supports very large amounts of data, such as database applications.
  4. Example: Prime number generation by two distinct algorithm(see APL, A+, J, Q'Nial, yorick version).

    primes : { &0,2=+/0=x!/:x:1+!x }
    
    sieve : { [ n ]
      r : n^0.5
      s : 0,(n-1)#1
      p : 0
      while[ p<r;
        p +: 1+(p _ s)?1;
        s[-1+1_ p*1+!_ n%p] : 0
      ]
      1+&s }
    

  5. References:

[top]