reworked deprecation to retain old procs
This commit is contained in:
parent
2a0f7b5de7
commit
1cdbd6b0a5
3 changed files with 14 additions and 3 deletions
|
|
@ -117,14 +117,17 @@ proc write*(s: Stream, x: string) =
|
||||||
## terminating zero is written.
|
## terminating zero is written.
|
||||||
writeData(s, cstring(x), x.len)
|
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, `$`]) =
|
proc writeLine*(s: Stream, args: varargs[string, `$`]) =
|
||||||
## writes one or more strings to the the stream `s` followed
|
## writes one or more strings to the the stream `s` followed
|
||||||
## by a new line. No length field or terminating zero is written.
|
## by a new line. No length field or terminating zero is written.
|
||||||
for str in args: write(s, str)
|
for str in args: write(s, str)
|
||||||
write(s, "\n")
|
write(s, "\n")
|
||||||
|
|
||||||
{.deprecated: [writeln:writeLine].}
|
|
||||||
|
|
||||||
proc read[T](s: Stream, result: var T) =
|
proc read[T](s: Stream, result: var T) =
|
||||||
## generic read procedure. Reads `result` from the stream `s`.
|
## generic read procedure. Reads `result` from the stream `s`.
|
||||||
if readData(s, addr(result), sizeof(T)) != sizeof(T):
|
if readData(s, addr(result), sizeof(T)) != sizeof(T):
|
||||||
|
|
|
||||||
|
|
@ -2526,6 +2526,10 @@ when not defined(JS): #and not defined(NimrodVM):
|
||||||
## Returns ``false`` if the end of the file has been reached, ``true``
|
## Returns ``false`` if the end of the file has been reached, ``true``
|
||||||
## otherwise. If ``false`` is returned `line` contains no new data.
|
## otherwise. If ``false`` is returned `line` contains no new data.
|
||||||
|
|
||||||
|
proc writeLn*[Ty](f: File, x: varargs[Ty, `$`]) {.inline,
|
||||||
|
tags: [WriteIOEffect], benign, deprecated.}
|
||||||
|
## **Deprecated since version 0.11.4:** Use **writeLine** instead.
|
||||||
|
|
||||||
proc writeLine*[Ty](f: File, x: varargs[Ty, `$`]) {.inline,
|
proc writeLine*[Ty](f: File, x: varargs[Ty, `$`]) {.inline,
|
||||||
tags: [WriteIOEffect], benign.}
|
tags: [WriteIOEffect], benign.}
|
||||||
## writes the values `x` to `f` and then writes "\n".
|
## writes the values `x` to `f` and then writes "\n".
|
||||||
|
|
|
||||||
|
|
@ -208,10 +208,14 @@ proc endOfFile(f: File): bool =
|
||||||
ungetc(c, f)
|
ungetc(c, f)
|
||||||
return c < 0'i32
|
return c < 0'i32
|
||||||
|
|
||||||
|
proc writeLn[Ty](f: File, x: varargs[Ty, `$`]) =
|
||||||
|
for i in items(x): write(f, i)
|
||||||
|
write(f, "\n")
|
||||||
|
|
||||||
proc writeLine[Ty](f: File, x: varargs[Ty, `$`]) =
|
proc writeLine[Ty](f: File, x: varargs[Ty, `$`]) =
|
||||||
for i in items(x): write(f, i)
|
for i in items(x): write(f, i)
|
||||||
write(f, "\n")
|
write(f, "\n")
|
||||||
{.deprecated: [writeln:writeLine].}
|
|
||||||
|
|
||||||
proc rawEcho(x: string) {.inline, compilerproc.} = write(stdout, x)
|
proc rawEcho(x: string) {.inline, compilerproc.} = write(stdout, x)
|
||||||
proc rawEchoNL() {.inline, compilerproc.} = write(stdout, "\n")
|
proc rawEchoNL() {.inline, compilerproc.} = write(stdout, "\n")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue