how to debug macros used with concept?

2022-03-22 Thread Araq
Why should type-checking produce output?

multiple definition of NimMainInner

2022-03-22 Thread Araq
Good question. Tried "nim devel"?

how to debug macros used with concept?

2022-03-22 Thread Dabod
Wow, thank you! I thought that only the generated nodes of the macro will be executed at runtime, why does `echo` need to be placed in `static:` here?

server-client webframework

2022-03-22 Thread choltreppe
Hi there, I just very recently stumbled upon nim, and I realy like it. And one thing I would like to have for nim is a client+server webframework. (like OCamls ocsigen or ur/web or opa-lang) So i decided to take initiative, and started writing something like that:

Anyone working on a new Nim book or second edition of Nim in Action?

2022-03-22 Thread ArchNemesis3301
I can't wait!! I will buy it immediately!!!

Anyone working on a new Nim book or second edition of Nim in Action?

2022-03-22 Thread ArchNemesis3301
It will be like the K & R C of Nim. Excited to know you are thinking about this!

how to debug macros used with concept?

2022-03-22 Thread xigoi
Clearly it is getting invoked, because if you change the return value to `false`, it fails the assertion.

runexe: Syntactic sugar for running/piping shell commands.

2022-03-22 Thread ArchNemesis3301
Hello Yardanico, I used run as a shorthand syntax for discard because I kept getting an error when calling a wrapper function from a python file without it being discarded in Nim first. And, yes, I also like the way it looked. You are also correct, it is simply a shorthand for discard & execCmd

runexe: Syntactic sugar for running/piping shell commands.

2022-03-22 Thread Yardanico
Nice, but I personally don't see much difference compared to using execCmd, and also confused by `run`. Did you add it just because you wanted to have spaces between `run cmd`? On another note, you don't need to use `export` to export your symbols - you can just use `*` to do the same, see e.g.

runexe: Syntactic sugar for running/piping shell commands.

2022-03-22 Thread ArchNemesis3301
Hello there, I just wanted to say hello to the community for the first time, and share a small library that I published today. Runexe was inspired by the verbosity I encountered when using the subprocess module in Python and I wanted something simple as well as an elegant way of executing shell

Read output only while input is not asked

2022-03-22 Thread Limits
I've found a way to do it using timeouts a.nim: import std/osproc, std/streams, std/times, std/threadpool, std/os proc readLineTimeout(readStream: Stream, timeout: float): int = var FlowVar = spawn readStream.readLine t = cpuTime() while cpuTime()

how to debug macros used with concept?

2022-03-22 Thread Hlaaftana
`concept` uses a form of `compiles` to work, meaning no code is actually executed in the verbatim statements. You can do something like this to get around it: proc check(t: typedesc): bool = t is int type Int = concept type t when not check(t): {.error.}

how to debug macros used with concept?

2022-03-22 Thread SolitudeSF
why should it? `check` macro isnt getting invoked.

how to debug macros used with concept?

2022-03-22 Thread geotre
Changing `echo "hello"` to `static: echo "hello"` produces the message

multiple definition of NimMainInner

2022-03-22 Thread mros
I'm using Nim to create multiple static libraries which will be used in a C project. But every static library has it's `*Main*` functions and linking multiple libraries in the same project causes this error: libA.a(@mlibB.nim.c.o): In function `NimMainInner': @mlibB.nim.c:(.text

my TUI designer.

2022-03-22 Thread JPLRouge
hello: I just finished my TUI designer. (LINUX) it is free and free. This demonstrates that we can go very far with "pure Nim" certainly not perfect, but does its job and relieves you from writing repetitive code.

how to debug macros used with concept?

2022-03-22 Thread Dabod
Expect `"Hello"` but nothing output () import macros macro check(t: typedesc) = echo "hello" newLit(true) type Checkable = concept type t check(t) == true assert int is Checkable Run Playground link