Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,6 @@
(let (xs '(a b c))
(until (empty? (rest xs))
(print (pop xs) ", "))
(println (pop xs)))
a, b, c

View file

@ -0,0 +1,5 @@
(let (xs (sequence 1 10)
x)
(while (set 'x (pop xs))
(print x)
(when xs (print ", "))))

View file

@ -0,0 +1 @@
(println (join (map string (sequence 1 10)) ", "))

View file

@ -0,0 +1,10 @@
(define (for-each-tail _func _list)
(until (empty? _list)
(_func _list)
(pop _list)))
(for-each-tail
(fn (xs)
(print (xs 0))
(if (rest xs) (print ", ")))
(sequence 1 10))

View file

@ -0,0 +1,11 @@
MODULE LoopsNPlusOneHalf1;
IMPORT Out;
VAR i :INTEGER;
BEGIN
FOR i := 1 TO 10 DO
Out.Int( i, 0 );
IF i < 10 THEN Out.String( ", " ) END
END
END LoopsNPlusOneHalf1.

View file

@ -0,0 +1,16 @@
MODULE LoopsNPlusOneHalf;
IMPORT Out;
VAR i :INTEGER;
BEGIN
i := 0;
WHILE i < 9 DO
INC( i );
Out.Int( i, 0 );
Out.String( ", " )
ELSIF i < 10 DO
INC( i );
Out.Int( i, 0 )
END
END LoopsNPlusOneHalf.

View file

@ -0,0 +1,11 @@
program n_plus_one_half;
loop init
i := 1;
doing
nprint(i);
while i < 10 do
i +:= 1;
nprint(", ");
end loop;
print;
end program;