version0.7.10
This commit is contained in:
parent
4d4b3b1c04
commit
36818817bd
14 changed files with 1011 additions and 0 deletions
18
tests/tarray2.nim
Normal file
18
tests/tarray2.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# simple check for one dimensional arrays
|
||||
|
||||
type
|
||||
TMyArray = array[0..2, int]
|
||||
|
||||
proc mul(a, b: TMyarray): TMyArray =
|
||||
result = a
|
||||
for i in 0..len(a)-1:
|
||||
result[i] = a[i] * b[i]
|
||||
|
||||
var
|
||||
x, y, z: TMyArray
|
||||
|
||||
x = [ 4, 5, 6 ]
|
||||
y = x
|
||||
echo repr(mul(x, y))
|
||||
|
||||
#OUT [16, 25, 36]
|
||||
Loading…
Add table
Add a link
Reference in a new issue