Generic methods are deprecated?

2023-02-04 Thread saemideluxe
Sorry to wake up the thread 3 years later, but it is the only Google-result that shows up :D So, the deprecated message still shows up, but it seems to be working well. I am writing a small scene-graph for my render engine and wonder whether I should transition away from generic methods or not.

Toying with a direct C "includes" in the compiler

2023-02-04 Thread elcritch
I'm avoiding doing useful things at the moment. So I tweaked the source filters in the compiler to include raw C files. Here's an example: import hashes include "testing.c" proc add(a, b: cint): cint {.importc.} echo add(1, 2) Run Actually you can do

Interface C++ objects with `wasMoved`?

2023-02-04 Thread elcritch
Recently I was using Nim with a hybrid C++ app using the handy `cppstl` library. When I tried using the `threading/channels` I was running into either double free's or memory leaks. I think it was due to a combination of `wasMoved` and C++ destructors. I'm curious if it's possible to get C++ ob

command line parametr with whitespace

2023-02-04 Thread cblake
Oh, yeah, FWIW, @domogled's apparent intent can be gotten with let x = r--title:new title with whitespace # ^start with " can skip 1^ Run on both Linux & Windows. Not great, but maybe not totally useless. There are "better" external thin

command line parametr with whitespace

2023-02-04 Thread SolitudeSF
wonder, what is the point of having in stdlib stuff that is completely broken.

How to listen to an IPv6 address but also allow IPv4

2023-02-04 Thread mildred
I copy-pasted the dial code from the stdlib, made it work with async sockets, replaced connect with bind and here it is:

How to listen to an IPv6 address but also allow IPv4

2023-02-04 Thread mildred
I believe I have to use dial:

How to listen to an IPv6 address but also allow IPv4

2023-02-04 Thread mildred
If you want to look at the code it's here although I believe it's not necessary to understand the issue:

How to listen to an IPv6 address but also allow IPv4

2023-02-04 Thread mildred
I'm writing daemons in Nim, and I fail to get it working with IPv6 My nim code uses a socket created by `newAsyncSocket()` from `asyncnet` and uses `bindAddr` to bind the socket to an address specified on the command-line. The bind address is specified in the form of a hostname and when the host

nimqt - bindings to Qt

2023-02-04 Thread Isofruit
Just tried to run the example on Arch-linux on nim 1.6.10. Basically ran `nimble install https://github.com/jerous86/nimqt`, copy pasted the code under example, then ran `nim cpp -r src/nimqtplay.nim.` That lead to: .../nimqtplay/src/nimqtplay.nim(5, 26) Error: type mismatch: got <

command line parametr with whitespace

2023-02-04 Thread shirleyquirk
There is a bug in `parseCmdLine` when not on windows. [this line](https://github.com/nim-lang/Nim/blob/e0328e28ee6b3fbfea812ffc2ce435ff76ccbc5a/lib/pure/os.nim#L2830) should probably be: while i < c.len and c[i] > ' ' and not (c[i] in

command line parametr with whitespace

2023-02-04 Thread cblake
Possibly helpful. The impl on Windows & Unix differs (big `when` and documented differences in `lib/std/cmdline.nim`). On Linux one sees (instead of what @enthus1ast describes): import os let x = r"""--title "new title with whitespace # ^space needed

command line parametr with whitespace

2023-02-04 Thread enthus1ast
I just tried the code you sent (on a wi does 10)

command line parametr with whitespace

2023-02-04 Thread domogled
thanks, it seems to depend on the system settings Im use Linux Manjaro (Mabox), fish shell (when I use bash, the result is the same). What do you use? thanks

Time compare with now

2023-02-04 Thread ingo
> import times or accidentally import `parseutils` instead of `strutils`? import std/[strutils, times] let ts = parseInt("1517875206") d = fromUnix(ts).utc now = now().utc echo "ts = ", ts echo "d = ", d echo "now = ", now if no