Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
GENERIC INTERFACE GenericSwap(Elem);
PROCEDURE Swap(VAR left: Elem.T; VAR right: Elem.T);
END GenericSwap.

View file

@ -0,0 +1,11 @@
GENERIC MODULE GenericSwap(Elem);
PROCEDURE Swap(VAR left: Elem.T; VAR right: Elem.T) =
VAR temp: Elem.T := left;
BEGIN
left := right;
right := temp;
END Swap;
BEGIN
END GenericSwap.

View file

@ -0,0 +1 @@
INTERFACE IntSwap = GenericSwap(Integer) END IntSwap.

View file

@ -0,0 +1 @@
MODULE IntSwap = GenericSwap(Integer) END IntSwap.

View file

@ -0,0 +1,12 @@
MODULE Main;
IMPORT IntSwap, IO, Fmt;
VAR left := 10;
right := 20;
BEGIN
IO.Put("Left = " & Fmt.Int(left) & "\n");
IntSwap.Swap(left, right);
IO.Put("Left = " & Fmt.Int(left) & "\n");
END Main.