Unfortunately I have no time to test this pull request,but I can give one more
example which may help to pinpoint the issue:
# test350.nim
import os,times
echo now().utc
let filename = extractFileName(getAppFilename())
let fi = getFileInfo(filename)
on latest devel , linux
compile with : nim c --gc:arc -r test350
#test350.nim
import times
echo now().utc
Run
output
/home/lxuser/.choosenim/toolchains/nim-#devel/lib/pure/times.nim(1090)
test350
/home/lxuser/.choosenim/toolcha
Here a mini example which displays this error on nim-devel :
#cxtimeb.nim
import sequtils
template doit():untyped =
## doit
## return output only
toSeq([1,2,3,4,5])
echo doit()
Run
Output ok :
There are no runnableExamples in my module.
The module imports sequtils
The only way I found to circumvent this error in docgen is to add following line
in my module :
export sequtils
Run
I think this should not be required.
After most recent improvements to doc generation I see this error running nim
doc :
/home/lxuser/.cache/nim/cxtimeb_d/runnableExamples/cxtimeb_examples1.nim(15,
12) Error: undeclared identifier: 'toSeq'
[runnableExamples] failed: generated file:
'/home/lxuser/.cache/nim/cxtime
But await works only inside an async proc
were as asyncCheck can be used like this:
when isMainModule :
asyncCheck mastercon()
runForever()
Run
How can we do:
when isMainModule :
await mastercon()
runForever()
A small contrieved example to illustrate the issue :
template doit(s:untyped):untyped =
stdout.write(s)
""
stdout.writeLine(doit("Hello: "), "This is ", doit("nice ,too."),"Is n't
it?")
stdout.writeLine(doit("Hello: "), doit("This is "), do
Take a look at
[https://github.com/qqtop/NimCx](https://github.com/qqtop/NimCx)
which was made for similar problems.
You could do something like
import nimcx
var nocolor:bool = false
printLnBiCol("exit (quitting the app)", colLeft = if nocolor==true:
term
32-bit system:
69.8084 s on an Intel Atom N470 @ 1.83Ghz 2 threads running on parrot Linux
4.10.0-parrot-20t-686-pae i686 with 1GB memory.
import nimpy
echo("Hello")
Run
gives with latest nim devel 0.19.9 :
/home/nord1/.nimble/pkgs/nimpy-0.1.0/nimpy/py_lib.nim(114, 5) Error:
invalid type: 'Complex' in this context: 'PyLib' for var
Run
works ok with nim 0.19.0
import strutils
import unicode
let words = "this does not work ".strip()
Run
gives here on latest dev branch and after recent changes/additions to
unicode.nim
test145.nim(4, 34) Error: ambiguous call; both strutils.strip(s: string,
leading: bool, trailing
Thank you all for the replies ... for the time being I go with the 'Hack way'
as it resolves the issue at hand without the need to change terminal encoding
or doing it the 'Proper way'
If there is yet another solution , I sure still would like to learn about it.
>From a database query I get strings like that :
"\u5f9e\u6e05\u6668\u958b\u59cb\u4e00\u76f4\u4e0b\u96e8\u3002"
if this string is hardcoded then display via echo is as expected, however, if
the string is passed in on command line echo fails to do its magic.
# test
Congratulations !
I especially like the neural network examples and hope more
will be forthcoming.
I see warnings that callsite() is being deprecated.
I use this macro and would like to know how to rewrite
it without using callsite() to achieve the same effect.
macro styledEchoPrint*(m: varargs[untyped]): typed =
## partially lifted from an earler macro in terminal.nim and
can see this in action here where a python based database driver is called.
[https://github.com/qqtop/NimFirebird](https://github.com/qqtop/NimFirebird)
[https://github.com/qqtop/NimFirebird/blob/master/firebird.nim](https://github.com/qqtop/NimFirebird/blob/master/firebird.nim)
Unfortunately does
Thanks, that clears it up. I only was focused on the middle error message as it
seemed to pertain to the issue at hand . As always reading docs is a real
challenge...
Issues with httpclient timeout
import httpclient
let callav =
"https://github.com/nim-lang/Nim/blob/devel/tests/arithm/tand.nim";
var zcli = newHttpClient()
echo zcli.getContent(callav,timeout = 1) # < fails
#echo zcli.getContent(callav)
Maybe you have the newer python6 on Ubuntu or the .so file has a different link
name ? For me the second example compiles without error on openSuse Tumbleweed.
# The imported Python3 initialization function
proc initialize*(){.cdecl, importc: "Py_Initialize" dynlib:
"libpython3.
On my machine I find that
s = newSeqOfCap[int](128)
is about 10 times slower than
s = newSeq[int]()
@dom96
I would vote against sub-forums for different languages and rather suggest to
anyone to use one of the translator plugins in modern browsers like:
[https://addons.mozilla.org/id/firefox/addon/s3google-translator](https://addons.mozilla.org/id/firefox/addon/s3google-translator)/
or others
As Nim grows , there will be the need of a management structure
and the sooner this is implemented the better the foundation
for future growth will be.
An example of this could be :
[http://www.firebirdsql.org/en/firebird-foundation](http://forum.nim-lang.org///www.firebirdsql.org/en/firebird-f
Nim is great because it has this underdog spirit taking on all and everyone, it
is down to earth , not overly academic and most of it is fun.
The excitement feels similar to when I was changing from Fortran77 to Turbo
Pascal , if I recall that correctly. :P
23 matches
Mail list logo