Fix #11
This commit is contained in:
parent
ae91f91552
commit
cba87d5469
1 changed files with 7 additions and 6 deletions
|
|
@ -48,19 +48,20 @@ To create an operator, the symbols that are to be used must be encased inside ``
|
||||||
``` nimrod
|
``` nimrod
|
||||||
proc `$`(a: array[2, array[2, int]]): string =
|
proc `$`(a: array[2, array[2, int]]): string =
|
||||||
result = ""
|
result = ""
|
||||||
for y in a:
|
for v in a:
|
||||||
for vx in v:
|
for vx in v:
|
||||||
result.add($vx & ", ")
|
result.add($vx & ", ")
|
||||||
result.add("\n")
|
result.add("\n")
|
||||||
|
|
||||||
echo [[1, 2], # See Varargs for how
|
echo([[1, 2], [3, 4]]) # See varargs for
|
||||||
[3, 4]] # echo works
|
# how echo works
|
||||||
|
|
||||||
proc `^&*^@%`(a, b: string): string =
|
proc `^&*^@%`(a, b: string): string =
|
||||||
## An confusingly named useless proc
|
## An confusingly named useless operator
|
||||||
result = a[0] & b[high(str)]
|
result = a[0] & b[high(b)]
|
||||||
|
|
||||||
assert("foo" ^&*^@% "bar" == "fr")
|
assert("foo" ^&*^@% "bar" == "fr")
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Generic Functions
|
## Generic Functions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue