Comprehensive difference in read file to variable at once and by line

2022-02-11 Thread xigoi
Reading by lines: for ln in lines("file.txt"): echo ln Run

Questions about creating dll with Nim

2022-02-11 Thread Araq
`NimMain` is only required when you have top level statements in your program that need to run. (Assuming `--gc:orc -d:useMalloc`.)

Problem with winapi in nim

2022-02-11 Thread Araq
Nanu, das ist ja fast schon ein richtiger Satz. Hilft mir aber nicht weiter.

Problem with winapi in nim

2022-02-11 Thread JPLRouge
Hello wstring travaille comme string, mais supporte UTF8 etc... C++20 introduces the char8_t portable character type (UTF-8 encoded 8-bit Unicode). In C++20, u8 literal prefixes specify characters or strings of char8_t instead of char

Comprehensive difference in read file to variable at once and by line

2022-02-11 Thread mardiyah
How're syntax differences in read file to variable by at once i.e. slurping it and line by line As I know/think this is only slurping it > `var whole = readFile(textfile)` please put the clear, correct comparative ones here

Release or pgp signed tag for csources_v1 and Nimble to accompany Nim 1.6.4?

2022-02-11 Thread tmsa04
I found a workaround, nim_csourcesHash in config/build_config.txt gives the required commit and it can be downloaded as a tar.gz from a commit on GitHub (didn't know that, perhaps nobody liked to mention it :) ) and nimble is a separate PKGBUILD in the repos unlike in nim-git and is up to date s

Problem with winapi in nim

2022-02-11 Thread Araq
Why would var pName: wstring if GetModuleBaseNameW(hNDL, 0, pName, 260) == 0: Run work? Maybe there is no storage associated with `pName`, I don't know the `wstring` type.

Problem with winapi in nim

2022-02-11 Thread elo
Hello, so i want to port a library that I wrote in go and that uses winapi to nim. However, I encountered a problem that I didn't have in go, the same calls in go return expected results but in nim i always get access denied. I can't figure out why this is happening, for example in go this funct

Release or pgp signed tag for csources_v1 and Nimble to accompany Nim 1.6.4?

2022-02-11 Thread tmsa04
I had observed for a long while Nim was stuck at 1.4 in Arch Linux, but researching it further I found the lack of check-summable releases or pgp signed tags or releases since that time has made it genuinely impossible to update any further due to the security requirements imposed by the packagi

Questions about creating dll with Nim

2022-02-11 Thread mratsim
I would love some foundational article about Nim for standalone DLLs / .so, ideally without having to call NimMain so that for library consumers they work like C libraries. This would be especially valuable for applications with a plugin system as well.

webscrape

2022-02-11 Thread planetis
Btw there is also

To insert a Nim variable into its PCRE regex

2022-02-11 Thread mardiyah
simply solved. thanks

best practice or guidelines on using log in a library?

2022-02-11 Thread arnetheduck
supports similar ideas around compile-time enabled logging and loggers, removing the logging code when not used (with lots and lots of fancy options and ways to create compile-time configurations). In practice however, compile-time based logging doe

Questions about creating dll with Nim

2022-02-11 Thread rockcavera
A long time ago I created a mIRC dll with C and I forgot to free a memory allocated with malloc and there was a leak. So, I believe that mIRC only controls the memory it allocates and the dll should be responsible for the memory it allocates itself. Thanks for the reply and advice.

Void as a type in a tuple

2022-02-11 Thread sls1005
I was wrong. The type of void is typedesc. Void cannot have a instance. assert void is typedesc #true Run

Void as a type in a tuple

2022-02-11 Thread sls1005
It's true that void is the type of void, but you still cannot use `tuple[string, void]` because it's a type without instances. assert void is type(void) #true assert type(void) is void #true assert void is void #true assert nil is not void #true assert void is not voi

To insert a Nim variable into its PCRE regex

2022-02-11 Thread adokitkat
To escape `{` or `}` you need to double it like `{{` / `}}`. It's explained in detail [here](https://nim-lang.org/docs/strformat.html#implementation-details). import re, strformat let num = r"\d*" wordNum = re(fmt"[a-z]\w*{num}{{") echo find("hello123{"

NImScript task and using a shebang line

2022-02-11 Thread PMunch
Yes `nimcr` has taken special care to stay out of the way as much as possible. It also supports various shebang weirdness so you can pass both compiler arguments and the script can take program arguments normally. The other big benefit of `nimcr` over `nim r` is of course the standardised outpu