renamed writeln to writeLine in tests

This commit is contained in:
patrick dw
2015-06-19 01:34:34 -05:00
parent b6252af5c6
commit 69e15ac32f
39 changed files with 456 additions and 456 deletions

View File

@@ -9,7 +9,7 @@ type
proc getPoint( p: var TPoint2d) =
{.breakpoint.}
writeln(stdout, p.x)
writeLine(stdout, p.x)
var
p: TPoint3d

View File

@@ -8,17 +8,17 @@ import macros
type
TFigure = object of RootObj # abstract base class:
draw: proc (my: var TFigure) {.nimcall.} # concrete classes implement this
proc init(f: var TFigure) =
proc init(f: var TFigure) =
f.draw = nil
type
TCircle = object of TFigure
radius: int
proc drawCircle(my: var TCircle) = stdout.writeln("o " & $my.radius)
proc init(my: var TCircle) =
proc drawCircle(my: var TCircle) = stdout.writeLine("o " & $my.radius)
proc init(my: var TCircle) =
init(TFigure(my)) # call base constructor
my.radius = 5
my.draw = cast[proc (my: var TFigure) {.nimcall.}](drawCircle)
@@ -29,13 +29,13 @@ type
proc drawRectangle(my: var TRectangle) = stdout.write("[]")
proc init(my: var TRectangle) =
proc init(my: var TRectangle) =
init(TFigure(my)) # call base constructor
my.width = 5
my.height = 10
my.draw = cast[proc (my: var TFigure) {.nimcall.}](drawRectangle)
macro `!` (n: expr): stmt {.immediate.} =
macro `!` (n: expr): stmt {.immediate.} =
let n = callsite()
result = newNimNode(nnkCall, n)
var dot = newNimNode(nnkDotExpr, n)
@@ -60,16 +60,16 @@ type
FHost: int # cannot be accessed from the outside of the module
# the `F` prefix is a convention to avoid clashes since
# the accessors are named `host`
proc `host=`*(s: var TSocket, value: int) {.inline.} =
proc `host=`*(s: var TSocket, value: int) {.inline.} =
## setter of hostAddr
s.FHost = value
proc host*(s: TSocket): int {.inline.} =
## getter of hostAddr
return s.FHost
var
var
s: TSocket
s.host = 34 # same as `host=`(s, 34)
stdout.write(s.host)
@@ -81,6 +81,6 @@ var
init(r)
init(c)
r!draw
c!draw()
c!draw()
#OUT 34[]o 5