[Karax] "include" statement doesn't work correctly inside karax DSL

2022-04-02 Thread Araq
FWIW I still think `typed` macros are Nim's future and `untyped` was a mistake. :-)

How setBlocking to false on newSocket?

2022-04-02 Thread thegrapevine
No. Thank you very much! Now works fine.

How setBlocking to false on newSocket?

2022-04-02 Thread ynfle
Do you have `std/nativesockets` imported?

How setBlocking to false on newSocket?

2022-04-02 Thread thegrapevine
When I try to run the code client.getFd.setBlocking(false) I get this error: Error: attempting to call undeclared routine: 'setBlocking'

Example implementing SQLite extension in Nim

2022-04-02 Thread jdf
For what it's worth, changing the Makefile nim invocation to nim --app:lib --dynlibOverride:libsqlite3 --passC:'-I$(HEADERS)' --passL:'-L$(LIB) -lsqlite3' c blah.nim Run now does seem to look at the correct headers, but generates a series of clang errors, including

[Karax] "include" statement doesn't work correctly inside karax DSL

2022-04-02 Thread ynfle
This is true for `untyped` macros, but a macro (like the one below) does have the `include` statement expanded to the ast of the included file. import macros macro t(x: typed) = echo repr x t: include tables Run

Clarity on mixin and pragma {.inject.}

2022-04-02 Thread PMunch
Not sure if you're asking for an explanation or praising him for his concise example. But these are completely different things. `mixin` allows a symbol to not point to anything when it's defined, to be "bound" when the procedure or template is used: template useLocal(): int =

Clarity on mixin and pragma {.inject.}

2022-04-02 Thread mardiyah
How amazing if it's given comment and explanation succinctly yet crystal clear..

Times - Intended use and difference between DateTime and Time

2022-04-02 Thread Symb0lica
As I understand it, the main differences between DateTime and Time are support for timezones and relative efficiencies in addition/subtraction compared to extracting date and time components. If you need to support multiple time zones or expect to issue more calls to extract components than

Clarity on mixin and pragma {.inject.}

2022-04-02 Thread Hlaaftana
template useLocal(): int = mixin local local + 1 assert not compiles(useLocal()) # `local` not declared, so template will not compile block: let local = 2 assert useLocal() == 3 template insertLocal() = let local {.inject.} = 2

Clarity on mixin and pragma {.inject.}

2022-04-02 Thread mardiyah
What's actually the difference functionality between mixin and {.inject.} (in clear comparative code explanation) ?

SiSix and Nim

2022-04-02 Thread xigoi
What leads you to that conclusion?

Control+C and procs launched with execCmd

2022-04-02 Thread teras
Hello I want to create a "wrapper" application in Nim, which will launch another process, and if this process exits, it needs to relaunch it. But of course I want to be able to terminate this procedure. In my mind I thought this would be easy: * add a `setControlCHook` which will add a

Naylib - yet another raylib wrapper becomes available

2022-04-02 Thread planetis
Naylib v1.2.0 stable update was released, synced with upstream. It contains quite a few bug fixes and extra wrapped functions. New: `loadFontFromData`, `loadShader`. Helps is still wanted for porting it into other platforms.

Caryng and Fotolanthropy: a Picture Perfect Designer-client Relationship

2022-04-02 Thread jahan111
At 99designs, we cherish relationships and are proud to have a platform that connects designers and clients, even past a contest win. We regularly hear from designers who have built their business’ foundation solely from the clients they’ve met through our site, and these stories are what we

SiSix and Nim

2022-04-02 Thread Recruit_main707
Wait, so this isn’t an April fools joke?

Times - Intended use and difference between DateTime and Time

2022-04-02 Thread volodymyr
Hi, I'm trying to understand the correct use of the `std/times` library. Specifically I'd like to know the intended use of the `DateTime` vs `Time`. A `DateTime` has all extractors and can be converted to a `Time`, while a `Time` has no extractors, but the arithmetic and comparison operations

[Karax] "include" statement doesn't work correctly inside karax DSL

2022-04-02 Thread Hlaaftana
There is no preprocessor. `include` is just like any other statement and thus gets evaluated in the same order as any other statement, and is represented in the AST as its own statement. What is given to the macro is literally the AST of `include test2`, and the macro can't do any processing on