summary refs log tree commit diff stats
path: root/tests/method/tmultim4.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/method/tmultim4.nim')
0 files changed, 0 insertions, 0 deletions
lt;ono@java.pl> 2015-09-04 23:04:32 +0200 committer Adam Strzelecki <ono@java.pl> 2015-09-04 23:04:32 +0200 tests: Trim .nim files trailing whitespace' href='/ahoang/Nim/commit/tests/procvar/tprocvar2.nim?h=devel&id=e80465dacf50f260abec30ae57d37b298c93fd83'>e80465dac ^
e792940f5 ^


e80465dac ^





2cdfe35e7 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32



                       
                             








                                         






                                    


                      





                

 
discard """
  file: "tprocvar.nim"
  output: "papbpcpdpe7"
"""
# test variables of type proc

proc pa() {.cdecl.} = write(stdout, "pa")
proc pb() {.cdecl.} = write(stdout, "pb")
proc pc() {.cdecl.} = write(stdout, "pc")
proc pd() {.cdecl.} = write(stdout, "pd")
proc pe() {.cdecl.} = write(stdout, "pe")

const
  algos = [pa, pb, pc, pd, pe]

var
  x: proc (a, b: int): int {.cdecl.}

proc ha(c, d: int): int {.cdecl.} =
  echo(c + d)
  result = c + d

for a in items(algos):
  a()

x = ha
discard x(3, 4)

#OUT papbpcpdpe7