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,21 @@
type
Eatable = concept e
eat(e)
FoodBox[e: Eatable] = seq[e]
Food = object
name: string
count: int
proc eat(x: int) = echo "Eating the int: ", x
proc eat(x: Food) = echo "Eating ", x.count, " ", x.name, "s"
var ints = FoodBox[int](@[1,2,3,4,5])
var fs = FoodBox[Food](@[])
fs.add Food(name: "Hamburger", count: 3)
fs.add Food(name: "Cheeseburger", count: 5)
for f in fs:
eat(f)