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:
|
for a in animals:
|
||||||
echo a.vocalize()
|
echo a.vocalize()
|
||||||
echo a.age_human_yrs()
|
echo a.ageHumanYrs()
|
||||||
```
|
```
|
||||||
``` console
|
``` console
|
||||||
$ nimrod c -r oop.nim
|
$ nimrod c -r oop.nim
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ let zero = ""
|
||||||
proc `+`(a, b: string): string =
|
proc `+`(a, b: string): string =
|
||||||
a & b
|
a & b
|
||||||
|
|
||||||
proc `*`[T, I](a: T, b: int): T =
|
proc `*`[T](a: T, b: int): T =
|
||||||
result = zero
|
result = zero
|
||||||
for i in 0..b:
|
for i in 0..b:
|
||||||
result = result + a
|
result = result + a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue