make tests green again

This commit is contained in:
Araq 2012-07-17 01:27:25 +02:00
commit 4f582da27f
19 changed files with 166 additions and 149 deletions

View file

@ -18,7 +18,7 @@ threadProcWrapper[int]()
threadProcWrapper[bool]()
type
TFilterProc[T,D] = proc (item: T, env:D): bool
TFilterProc[T,D] = proc (item: T, env:D): bool {.nimcall.}
proc filter[T,D](data: seq[T], env:D, pred: TFilterProc[T,D]): seq[T] =
result = @[]

View file

@ -7,7 +7,7 @@ import macros
type
TFigure = object of TObject # abstract base class:
draw: proc (my: var TFigure) # concrete classes implement this proc
draw: proc (my: var TFigure) {.nimcall.} # concrete classes implement this
proc init(f: var TFigure) =
f.draw = nil
@ -21,7 +21,7 @@ proc drawCircle(my: var TCircle) = stdout.writeln("o " & $my.radius)
proc init(my: var TCircle) =
init(TFigure(my)) # call base constructor
my.radius = 5
my.draw = cast[proc (my: var TFigure)](drawCircle)
my.draw = cast[proc (my: var TFigure) {.nimcall.}](drawCircle)
type
TRectangle = object of TFigure
@ -33,7 +33,7 @@ proc init(my: var TRectangle) =
init(TFigure(my)) # call base constructor
my.width = 5
my.height = 10
my.draw = cast[proc (my: var TFigure)](drawRectangle)
my.draw = cast[proc (my: var TFigure) {.nimcall.}](drawRectangle)
macro `!` (n: expr): stmt =
result = newNimNode(nnkCall, n)

View file

@ -3,7 +3,7 @@ discard """
output: "5 - [1]"
"""
type
TProc = proc (n: int, m: openarray[int64])
TProc = proc (n: int, m: openarray[int64]) {.nimcall.}
proc Foo(x: int, P: TProc) =
P(x, [ 1'i64 ])

View file

@ -16,7 +16,7 @@ iterator toverl2(x: int): int =
inc(res)
var
pp: proc (x: bool): string = toverl2
pp: proc (x: bool): string {.nimcall.} = toverl2
stdout.write(pp(true))