Q'Nial: Queen's University Nested Interactive Array Language

[top]

  1. A mixture of APL2, LISP, FP and Pascal
  2. Example: Prime number generation by two distinct algorithm(see APL, A+, J, K, yorick version).

    primes IS OPERATION N {	
    	V := count N;
    	(2 match BYROWS REDUCE plus (0 match (V OUTER MOD V))) sublist V 
    }
    
    sieve IS OPERATION N {
    	R := sqrt N;
    	S := o hitch take (N - 1) l;
    	P := 0;
    	WHILE P <= R DO
    		P := P + 1 + find l (P drop S);
    		S := o (rest (P * count floor (N / P)) - 1) placeall S;
    	ENDWHILE;
    	S sublist count N
    }
    

[top]