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

+24
View File
@@ -0,0 +1,24 @@
# probe: a list of structs, averages, and round()
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: ada 84.0 84.0
# expect-stdout: bo 77.0 77.0
@fieldwise_init
struct Student(Copyable, Movable):
var name: String
var scores: List[Int]
def mean(self) -> Float64:
var total = 0
for s in self.scores:
total += s
return Float64(total) / Float64(len(self.scores))
def main():
var a: List[Int] = [90, 85, 77]
var b: List[Int] = [60, 72, 81, 95]
var people = List[Student]()
people.append(Student("ada", a^))
people.append(Student("bo", b^))
for p in people:
print(p.name, p.mean(), round(p.mean()))