start of tests refactoring; sqlite3 new wrapper fixes

This commit is contained in:
rumpf_a@web.de 2010-02-21 19:42:36 +01:00
commit d913fdb280
173 changed files with 206 additions and 238 deletions

View file

@ -1,25 +0,0 @@
# Test overloading of procs when used as function pointers
import strutils
proc parseInt(x: float): int = nil
proc parseInt(x: bool): int = nil
proc parseInt(x: float32): int = nil
proc parseInt(x: int8): int = nil
proc parseInt(x: TFile): int = nil
proc parseInt(x: char): int = nil
proc parseInt(x: int16): int = nil
type
TParseInt = proc (x: string): int
var
q = TParseInt(parseInt)
p: TParseInt = parseInt
proc takeParseInt(x: proc (y: string): int): int =
result = x("123")
echo "Give a list of numbers (separated by spaces): "
var x = stdin.readline.split.each(parseInt).max echo x, " is the maximum!" echo "another number: ", takeParseInt(parseInt)