The afterRunEvent callback will give you the Process.
You mean something like this?
[https://play.nim-lang.org/#ix=1Oki](https://play.nim-lang.org/#ix=1Oki)
Thanks, I did take a look at that, but from the docs it looks like
`execProcesses` doesn't allow me to get the return value of all executions. Or
am I misinterpreting that?
I'm referring to the ability of D templates beyond the ability to write
function or struct class templates, but templates over blocks that include new
types and variables, almost like the parameterized module system of OCaml.
Forgive me for writing D here, I'll translate it to Future Nim soon ;-
Yeah, we know, but we haven't yet got a PR to fix this. (Hint, hint!)
To be honest, I'm not sure what you mean? Can you elaborate? Do you refer to
[https://dlang.org/spec/template.html#aliasparameters](https://dlang.org/spec/template.html#aliasparameters)
?
Hello everyone! I am a new Nim user (and, I have to say, I am pretty excited
about this language!) coming from Julia. I was tesing some of Nim's
capabilities when coming to generic types and procs, when I ran into this code
not compiling:
type
AbstractType = int or string
Github pull request:
[https://github.com/nim-lang/Nim/pull/11702](https://github.com/nim-lang/Nim/pull/11702).
These association lists, often abbreviated "alist", get a lot of play in lisp,
but also OCaml, Haskell, etc..
[https://en.wikipedia.org/wiki/Association_list](https://en.wikipedia.org/wiki/Association_list)
@dawkot, unfortunately your implementation has a big performance flaw.
the sleepAsync 5 creates a minimum bound of 5 ms on the execution time + the
time it takes to run through the event loop. It's the naive solution to the
problem.
The more correct way to accomplish this with async is to regis
> What prevents it from being used only like this without "%", "@" or "toTable"?
Just a two comments above:
> `{}` is a sugar for array of tuples
.
What prevents it from being used only like this without "%", "@" or "toTable"?
var a = {"key_1": "value_1", "key_2": "value_2"}
Run
It's simple and everyone understands!
Due to the changes in emscripten you mentioned, my own WASM example code now
compiles and runs fine with the following simple nim.cfg:
@if emscripten:
cc = clang
clang.exe = "emcc"
clang.linkerexe = "emcc"
cpu = i386
@end
Run
and this co
It would be something like this:
import std / [osproc, streams, asyncdispatch]
proc asyncProcess(cmd: string, args: seq[string]): Future[(int, string)]
{.async.} =
var p = startProcess(cmd, args=args)
while p.running: await sleepAsync 5
return (p.peekExitC
> I'm not particularly bothered whether it's threads or async, I just want to
> execute the command in parallel rather than sequentially.
Of course we know that async mean "non blocking", but not really parallel, see
[https://stackoverflow.com/questions/6133574/how-to-articulate-the-difference-b
osproc execProcesses?
[https://nim-lang.github.io/Nim/osproc.html#execProcesses%2CopenArray%5Bstring%5D%2Cproc%28int%29%2Cproc%28int%2CProcess%29](https://nim-lang.github.io/Nim/osproc.html#execProcesses%2CopenArray%5Bstring%5D%2Cproc%28int%29%2Cproc%28int%2CProcess%29)
16 matches
Mail list logo