Re: Supress errors

2018-08-17 Thread emekoi
if your errors are from exceptions then just find where your exceptions are 
being thrown and wrap them in a `try: #[your code here]# except: discard`.


Re: Cross-compiling [Win->Lin]

2018-08-17 Thread Aiesha_Nazarothi
> you'll need a cross compiling toolchain. afaik mingw can't compile from 
> windows to linux, although it works the other way around.

Yes, I found only cross-compilers for Linux. No luck with MinGW it seems ?


Re: Cross-compiling [Win->Lin]

2018-08-17 Thread emekoi
you'll need a cross compiling toolchain. afaik mingw can't compile from windows 
to linux, although it works the other way around.


Re: Cross-compiling [Win->Lin]

2018-08-17 Thread juancarlospaco
You answer your own question. Get full mingw I think.


Re: do regular expression on unicode string?

2018-08-17 Thread dataman
Try this: 


import nre

let txt = "自我 我们 我"  # this is actually read from external file
let r = re"(*U).{0,1}我.{0,1}"

for res in findAll(txt, r):
  echo res


Run

Show for me:


自我
我们
 我


Run


do regular expression on unicode string?

2018-08-17 Thread oyster

import re
import unicode

var txt = "自我 我们 我"  # this is actually read from external file

#~ txt = txt.toRunes()
# type mismatch: got  but expected 'string'

var result = txt.findall(re".{0,1}我.{0,1}")
for i in result:
echo i # "自我", "我们", "我" are expected


Run

will display 


▒我
我▒
 我


Run

as the code says, if I convert txt to runes, then the txt.findall says "type 
mismatch: got  but expected 'string'". But the above code does not 
find the whole unicode characters around "我" which is not right answer

So any suggestion? Thanks 


Re: for loop with more items

2018-08-17 Thread kaushalmodi
The a, b are not actually start/end values. They are arbitrary elements from 
the first and second slices (r[0] and r[1]). 


Re: for loop with more items

2018-08-17 Thread mratsim
Maybe Slice should use (slice_start, slice_end) for naming instead of (a, b).


Cross-compiling [Win->Lin]

2018-08-17 Thread Aiesha_Nazarothi
Recently I tried to build Linux distributive for my recent project, yet found 
compiler stuck on following error: 


\nimcache\stdlib_system.c:11:22: fatal error: sys/mman.h: No such file or 
directory #include 

Run

Of course it's not available on Windows, yet what should I do now ? Fetch some 
from MinGW for Linux ?


Re: nim.cfg: how to have conditional flags to depend on compiler version?

2018-08-17 Thread Araq
I think it's impossible to do that in `nim.cfg`. Sorry.


Re: Supress errors

2018-08-17 Thread Serasar
With errors. I want to run my program in the background, and supress occasional 
errors so they won't bother me


Re: Supress errors

2018-08-17 Thread Araq
What dialog boxes? When they popup, you have a bug in your code...


Re: How do I compile an example with SQLite using db_sqlite?

2018-08-17 Thread yatesco
I am a newbie, but I had a similar problems which was fixed by the awesome 
community.

Details: 
[https://github.com/yatesco/docker-nim-dev-example](https://github.com/yatesco/docker-nim-dev-example)