Note: The mercurial server is disabled at the moment while I investigate whether it can run with an acceptably low CPU load – Mike.

Example.p (Compilers)

Copyright © 1993–2025 J. M. Spivey
Jump to navigation Jump to search
(* An example of control structures with short-circuit conditions *)

begin
  i := 0; d := -1; m := 35;
  while (i < 10) and (d < 0) do
    if (i > 1) and (m mod i = 0) then
      d := i
    end;
    i := i+1
  end;
  print m; newline
end.