Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,19 @@
with Ada.Text_IO;
procedure Repeat_Example is
procedure Repeat(P: access Procedure; Reps: Natural) is
begin
for I in 1 .. Reps loop
P.all; -- P points to a procedure, and P.all actually calls that procedure
end loop;
end Repeat;
procedure Hello is
begin
Ada.Text_IO.Put("Hello! ");
end Hello;
begin
Repeat(Hello'Access, 3); -- Hello'Access points to the procedure Hello
end Repeat_Example;

View file

@ -0,0 +1,12 @@
void proc() {
write(" Inside loop");
}
void repeat(void func(), int times) {
for (int i = 0; i < times; ++i) {
func();
}
}
repeat(proc, 5);
write("Loop Ended");

View file

@ -0,0 +1,13 @@
config const n = 5;
proc example()
{
writeln("example");
}
proc repeat(func, n)
{
for i in 0..#n do func();
}
repeat(example, n);

View file

@ -0,0 +1,13 @@
config const n = 5;
proc example()
{
writeln("example");
}
proc repeat(func : proc(), n : uint)
{
for i in 0..#n do func();
}
repeat(example, n);

View file

@ -0,0 +1,13 @@
config const n = 5;
proc example(x : uint)
{
writeln("example ", x);
}
proc repeat(func : proc(x : uint), n : uint)
{
for i in 0..#n do func(i);
}
repeat(example, n);

View file

@ -0,0 +1,7 @@
4.times{ puts "Example" } # idiomatic way
def repeat(proc,num)
num.times{ proc.call }
end
repeat(->{ puts "Example" }, 4)

View file

@ -0,0 +1,14 @@
void proc() {
print(" Inside loop");
}
void repeat(Function func, int times) {
for (var i = 0; i < times; i++) {
func();
}
}
void main() {
repeat(proc, 5);
print("Loop Ended");
}

View file

@ -0,0 +1,11 @@
procedure repeat(integer proc, integer times)
for i = 1 to times do
call_proc(proc, {})
end for
end procedure
procedure say_hello()
puts(1, "hello\n")
end procedure
repeat(routine_id("say_hello"), 3)

View file

@ -0,0 +1,15 @@
import gleam/io
pub fn main() {
repeat(3, fn() { io.println("hello") })
}
pub fn repeat(times: Int, func: fn() -> Nil) -> Nil {
case times {
_ if times < 1 -> Nil
_ -> {
func()
repeat(times - 1, func)
}
}
}

View file

@ -0,0 +1,12 @@
procedure main(A)
n := \A[1] | 10
runit(P,n) | write()
runit(Q,n) | write()
end
procedure runit(p,n)
every 1 to n do p()
end
procedure P(); writes("."); end
procedure Q(); writes("+"); end

View file

@ -0,0 +1,11 @@
function repeat(f, n) {
while (n-- > 0) {
f();
}
}
function test() {
console.log("test");
}
repeat(test, 3);

View file

@ -0,0 +1,15 @@
HAI 1.3
HOW IZ I REPEAT YR DEMANZ AN YR TIMEZ
IM IN YR LOOP UPPIN YR VAR TIL BOTH SAEM VAR AN TIMEZ
I IZ DEMANZ MKAY
IM OUTTA YR LOOP
IF U SAY SO
HOW IZ I SAYHELLO
VISIBLE "HELLO"
IF U SAY SO
I IZ REPEAT YR SAYHELLO AN YR 3 MKAY
KTHXBYE

View file

@ -0,0 +1,5 @@
repeat(f, n) := thru n do f()$
test() := print("test")$
repeat(test, 3);

View file

@ -0,0 +1,18 @@
uses console
sub proc
printl " Inside loop"
end sub
macro rep (func, n)
int i
for i = 1 to n
func()
next
end macro
rep (proc, 5)
printl "Loop Ended"
printl cr "Enter ..."
waitkey

View file

@ -1,13 +1,11 @@
-->
<span style="color: #008080;">procedure</span> <span style="color: #000000;">Repeat</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">rid</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">n</span><span style="color: #0000FF;">)</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">=</span><span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">n</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">rid</span><span style="color: #0000FF;">()</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
procedure Repeat(integer rid, integer n)
for i=1 to n do
rid()
end for
end procedure
<span style="color: #008080;">procedure</span> <span style="color: #000000;">Hello</span><span style="color: #0000FF;">()</span>
<span style="color: #0000FF;">?</span><span style="color: #008000;">"Hello"</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
procedure Hello()
?"Hello"
end procedure
<span style="color: #000000;">Repeat</span><span style="color: #0000FF;">(</span><span style="color: #000000;">Hello</span><span style="color: #0000FF;">,</span><span style="color: #000000;">5</span><span style="color: #0000FF;">)</span>
<!--
Repeat(Hello,5)

View file

@ -0,0 +1,10 @@
local function f(g, n)
for _ = 1, n do g(n) end
end
local function g(k)
for i = 1, k do io.write($"{i} ") end
print()
end
f(g, 5)

View file

@ -0,0 +1,14 @@
function Out-Example
{
"Example"
}
function Step-Function ([string]$Function, [int]$Repeat)
{
for ($i = 1; $i -le $Repeat; $i++)
{
"$(Invoke-Expression -Command $Function) $i"
}
}
Step-Function Out-Example -Repeat 3

View file

@ -0,0 +1,2 @@
⍥(&p"Hi") 3 # take repetitions as an argument
⍥₃(&p"Hi") # or a subscript, if you know the number ahead of time

View file

@ -0,0 +1,2 @@
Repeat! ← ◌⍢⊙^⊃±-₁
Repeat!(&p"Hi") 3