diff options
author | Araq <rumpf_a@web.de> | 2011-11-29 08:41:06 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-29 08:41:06 +0100 |
commit | 455994664ec838202df91592718442e478854aeb (patch) | |
tree | 6e26fa38097dff0c4812109bde4680f38a8cda31 /lib | |
parent | e261a88d074038391574402e88737af4752a1041 (diff) | |
download | Nim-455994664ec838202df91592718442e478854aeb.tar.gz |
old 'readline' and 'endOfFile' not deprecated anymore; too convenient for 1 liners (see examples/maximum.nim)
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/impure/rdstdin.nim | 4 | ||||
-rwxr-xr-x | lib/pure/streams.nim | 6 | ||||
-rwxr-xr-x | lib/system.nim | 9 |
3 files changed, 6 insertions, 13 deletions
diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim index 5d39186ce..57d6bfd4b 100755 --- a/lib/impure/rdstdin.nim +++ b/lib/impure/rdstdin.nim @@ -14,7 +14,7 @@ ## wanted functionality. when defined(Windows): - proc ReadLineFromStdin*(prompt: string): TaintedString {.deprecated.} = + proc ReadLineFromStdin*(prompt: string): TaintedString = ## Reads a line from stdin. stdout.write(prompt) result = readLine(stdin) @@ -32,7 +32,7 @@ when defined(Windows): else: import readline, history - proc ReadLineFromStdin*(prompt: string): TaintedString {.deprecated.} = + proc ReadLineFromStdin*(prompt: string): TaintedString = var buffer = readline.readLine(prompt) if isNil(buffer): quit(0) result = TaintedString($buffer) diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim index bef310d72..1db87a785 100755 --- a/lib/pure/streams.nim +++ b/lib/pure/streams.nim @@ -43,10 +43,9 @@ proc close*(s, unused: PStream) {.deprecated.} = ## closes the stream `s`. s.closeImpl(s) -proc atEnd*(s: PStream): bool {.deprecated.} = +proc atEnd*(s: PStream): bool = ## checks if more data can be read from `f`. Returns true if all data has ## been read. - ## **Deprecated since version 0.8.14**: Because Posix supports it poorly. result = s.atEndImpl(s) proc atEnd*(s, unused: PStream): bool {.deprecated.} = @@ -170,10 +169,9 @@ proc readLine*(s: PStream, line: var TaintedString): bool = line.string.add(c) result = true -proc readLine*(s: PStream): TaintedString {.deprecated.} = +proc readLine*(s: PStream): TaintedString = ## Reads a line from a stream `s`. Note: This is not very efficient. Raises ## `EIO` if an error occured. - ## **Deprecated since version 0.8.14**: Because Posix supports it poorly. result = TaintedString"" while true: var c = readChar(s) diff --git a/lib/system.nim b/lib/system.nim index f9f5760e4..f0a9f8266 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -1672,9 +1672,8 @@ when not defined(EcmaScript) and not defined(NimrodVM): proc Close*(f: TFile) {.importc: "fclose", nodecl.} ## Closes the file. - proc EndOfFile*(f: TFile): Bool {.deprecated.} + proc EndOfFile*(f: TFile): Bool ## Returns true iff `f` is at the end. - ## **Deprecated since version 0.8.14**: Because Posix supports it poorly. proc readChar*(f: TFile): char {.importc: "fgetc", nodecl.} ## Reads a single character from the stream `f`. If the stream @@ -1704,13 +1703,10 @@ when not defined(EcmaScript) and not defined(NimrodVM): proc write*(f: TFile, a: openArray[string]) ## Writes a value to the file `f`. May throw an IO exception. - proc readLine*(f: TFile): TaintedString {.deprecated.} + proc readLine*(f: TFile): TaintedString ## reads a line of text from the file `f`. May throw an IO exception. ## A line of text may be delimited by ``CR``, ``LF`` or ## ``CRLF``. The newline character(s) are not part of the returned string. - ## - ## **Deprecated since 0.8.14**: Use the `readLine` that takes a ``var`` - ## parameter instead. proc readLine*(f: TFile, line: var TaintedString): bool ## reads a line of text from the file `f` into `line`. `line` must not be @@ -1719,7 +1715,6 @@ when not defined(EcmaScript) and not defined(NimrodVM): ## ``CRLF``. The newline character(s) are not part of the returned string. ## Returns ``false`` if the end of the file has been reached, ``true`` ## otherwise. If ``false`` is returned `line` contains no new data. - proc writeln*[Ty](f: TFile, x: Ty) {.inline.} ## writes a value `x` to `f` and then writes "\n". ## May throw an IO exception. |