Initial commit
Test (in pplus-core) / in-core (push) Failing after 28m44s

This commit is contained in:
alexm committed 2026-11-12 22:23:48 -05:00
commit 568474d52f
1591 files changed
+528213

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
# probe: a function as a compile-time parameter, f: def(Int) thin -> Int in brackets (the manual's inplace_transform), with a named function and a lambda that captures nothing
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: [-3, -1, -4]
# expect-stdout: [9, 1, 16]
def map_in_place[f: def(Int) thin -> Int](mut xs: List[Int]):
for i in range(len(xs)):
xs[i] = f(xs[i])
def negate(x: Int) -> Int:
return -x
def main():
var xs: List[Int] = [3, 1, 4]
map_in_place[negate](xs)
print(xs)
map_in_place[lambda (x: Int) -> Int: x * x](xs)
print(xs)