reworked deprecation to retain old procs

This commit is contained in:
patrick dw 2015-06-19 18:50:01 -05:00
commit 1cdbd6b0a5
3 changed files with 14 additions and 3 deletions

View file

@ -117,14 +117,17 @@ proc write*(s: Stream, x: string) =
## terminating zero is written.
writeData(s, cstring(x), x.len)
proc writeLn*(s: Stream, args: varargs[string, `$`]) {.deprecated.} =
## **Deprecated since version 0.11.4:** Use **writeLine** instead.
for str in args: write(s, str)
write(s, "\n")
proc writeLine*(s: Stream, args: varargs[string, `$`]) =
## writes one or more strings to the the stream `s` followed
## by a new line. No length field or terminating zero is written.
for str in args: write(s, str)
write(s, "\n")
{.deprecated: [writeln:writeLine].}
proc read[T](s: Stream, result: var T) =
## generic read procedure. Reads `result` from the stream `s`.
if readData(s, addr(result), sizeof(T)) != sizeof(T):