Merge branch 'master' of https://github.com/flaviut/nimrod-by-example
This commit is contained in:
commit
728f51a2ee
2 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ animals.add(Cat(name: "Mitten", age: 10))
|
|||
|
||||
for a in animals:
|
||||
echo a.vocalize()
|
||||
echo a.age_human_yrs()
|
||||
echo a.ageHumanYrs()
|
||||
```
|
||||
``` console
|
||||
$ nimrod c -r oop.nim
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ let zero = ""
|
|||
proc `+`(a, b: string): string =
|
||||
a & b
|
||||
|
||||
proc `*`[T, I](a: T, b: int): T =
|
||||
proc `*`[T](a: T, b: int): T =
|
||||
result = zero
|
||||
for i in 0..b:
|
||||
result = result + a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue