Q'Nial

1 program Added 2026-02-26T12:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: QNial, QNial7
Provenance: commit 88c407e9e0 · authored 2026-02-26T15:47:53+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Qnial (0.71)Nial (0.44)JOVIAL (0.11)JOVIAL J3 (0.09)Tutorial D (0.08)

LLM-contributed programs

Primes to 1000

Provenance: commit 88c407e9e0 · authored 2026-02-26T15:47:53+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.ndf · license: GPL-3.0 · added: 2026-02-26T12:00:00Z
# Generating primes in the old fashioned way


# Test if a number is a prime by examining the residue of division
# by all numbers less than or equal to the square root of the number.
# If no residue is 0 the number is a prime. 

isp is operation X { 
    (X > 1) and (and (0 < (X eachright mod (2 drop tell (1 + floor sqrt X))))) }


# Find all primes up to the supplied number by testing each to see if it
# is a prime and then selecting the sublist of numbers that are primes.

isp_list is op N {
  r := each isp (count N);
  r sublist (count N)
}

# Find the primes up to 1000. If you want to run this interactively
# then remove the 'bye' line and use
#
#     Nial -i
#     loaddefs "primes

write ('Primes to 1000' (isp_list 1000));

# That's all folks

bye;

Contribute — propose a file extension

Tell us where to find evidence about Q'Nial (mapped to pl/q_nial). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Q'Nial/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Q# Q-BAL →