blob: fab56464781a0bc074c7d9eeb3285a19dc316792 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
{.used.}
func eprint*(s: varargs[string, `$`]) = {.cast(noSideEffect), cast(tags: []), cast(raises: []).}:
var a = false
var o = ""
when nimVm:
for x in s:
if not a:
a = true
else:
o &= ' '
o &= x
echo o
else:
for x in s:
if not a:
a = true
else:
o &= ' '
o &= x
o &= '\n'
stderr.write(o)
func elog*(s: varargs[string, `$`]) = {.cast(noSideEffect), cast(tags: []), cast(raises: []).}:
var f: File
if not open(f, "a", fmAppend):
return
var a = false
var o = ""
for x in s:
if not a:
a = true
else:
o &= ' '
o &= x
o &= '\n'
f.write(o)
close(f)
|