What are you writing using nim? does it in production?
Hi,
I have prepared gdb python script that should ease a lot of debugging pain. If
anyone interested to give it a try, location is
[https://github.com/cooldome/Nim-gdb](https://github.com/cooldome/Nim-gdb).
Currently this script requires latest devel Nim and also needs this pull
request:
I don't have time right at this very moment, but I will take a look at this
within the next few days and see if there are any changes I can make to get a
faster runtime. Love all your comments by the way.
I use this
[nim.cfg](https://gist.github.com/mashingan/6cd3af4528ad5c11ed4f27f3aac72cc4) .
I recently wiped my vcc compilers so I cannot try it again but that's the cfg
when I played around using vcc.
> What's the difference between have the : and not having it. I've seen both
> cases in the docs and code.
Perhaps what you've seen is passing blocks of code using the colon like this?
template foo(actions: untyped): untyped =
actions
foo:
# anything here gets
Doesn't work with me. The same error still persists. Do you mind sharing your
nim.cfg?
Below is the Nim direct translation of the C++ code in my paper. I have
verified it on Nim 0.17 on Linux. In comparison on this same machine the Nim
code runs a bit faster for some (larger >= 10^9) test values (not
comprehensibly benchmarked yet).
I'll post it to a gist later to make it easier
Whoops, sorry, forgot to run the executable (probably should go to bed now)
[jzakiya@jabari-pc nim]$ ./inputtest
Enter integer number: 34422
You inputed 34422 with type BiggestUInt
[jzakiya@jabari-pc nim]$
Made the same mistake on target program, but it works now
I'm am running Manjaro KDE (gcc 7.1.1, clang 4.0.1) in a VirtualBox VM using
another Linux distros as VB host.
When I run this file:
inputtest.nim
import strutils, typetraits
stdout.write "Enter integer number: "
let val = stdin.readline.parseBiggestUInt
echo
How do you write your code? AFAIK, `readLine` is blocking.
In my machine, below code is working fine. Using Windows 10 with GCC v 7.1.0
import strutils, typetraits
stdout.write "Input integer number: "
let number = stdin.readline.parseBiggestUInt
echo "You inputed
These don't work.
When the program displays
Enter number value:
it should stay there until I type a number and hit and then proceed.
For both cases shown the program just falls through.
[jzakiya@jabari-pc nim]$ ./myprogram
Enter number value:
Error:
CMIIW, `object` is for value type while `ref object` is for reference type.
If the object would be used for many occasions and its construction quite
costly, it's better to use reference type then.
Use `parseBiggestUInt` proc in
[strutils](https://nim-lang.org/docs/strutils.html#parseBiggestUInt,string)?
You can do like this:
import strutils
let theint = stdin.readline.parseBiggestUInt
or
import strutils
var theint = -1'u64
try:
I want to input numbers into a program from the command line.
$ ./myprogram
Please iput number:
The input number are unsigned 64-bit (uint64)
I tried the following:
let var = uint64(readling(stdin, input)
But I apparently have to convert a string
When the function has no argument and return nothing (`void`), I saw sometimes
like this
proc main =
echo "In main proc"
when isMainModule:
main()
15 matches
Mail list logo