Re: Why does the this code work?
Well, we may ask: Why do we have openArray proc parameter type at all, when varargs works for multiple arguments, for a seq and for an array? So varargs should be able to fully substitute openArray parameter type. Maybe varargs has more overhead, or maybe there exists cases where we want to allow passing an array or a seq, but not multiple individual parameters?
Re: Why does the this code work?
But the code is for accepting multiple individual integers, not for accepting an array/sequence. It feels like the code isn't doing 'exactly' what it was intended to do. It's sort of doing more.
Re: Why does the this code work?
Why shouldn't it 樂? The implicit conversion to a varargs/openarray (same thing) is cheap.
Re: In love with Nim
Jjajajaj thanks.
Why does the this code work?
proc dispayVarargs(va: varargs[int]) = echo va.len var se: seq[int] = @[2, 3, 4] dispayVarargs(se) Run I am happy that it works but it feels like breaking design.
Re: Pipe operator in Nim
Hi Andreas, thanks for the clarification!
Re: What's the difference between varargs[T] and openArray[T]?
For an openArray parameter you can pass an array or a seq, but only a single one. For varargs parameter you can pass multiple arguments. I think the explanation at > [https://nim-lang.org/docs/manual.html#types-open-arrays](https://nim-lang.org/docs/manual.html#types-open-arrays) is fine, but I have to read it again from time to time for details.
What's the difference between varargs[T] and openArray[T]?
I've already gone through [https://forum.nim-lang.org/t/1063](https://forum.nim-lang.org/t/1063) but can't seem to understand the core idea. Can someone elaborate on it, and may be add things that might not have been covered previously.
Re: please advise: threading/GC - how make it work?
Also you might be interested in [https://github.com/johnnovak/illwill](https://github.com/johnnovak/illwill), which is kinda similar to what stui does
Re: Is it possible to see sql executed?
If you use Norm, you can use logging module to log all generated queries, just add import logging; addHandler newConsoleLogger()
Re: Pipe operator in Nim
because of ufcs you can use . e.g a.echo
Re: Is it possible to see sql executed?
You should be able to just echo string(theQuery) Run
Re: please advise: threading/GC - how make it work?
To install packages that aren't on the official list just install directly from github: `nimble install https://github.com/nais314/stui`. To add them to the official list make a PR to add them to packages.json in the [packages repo](https://github.com/nim-lang/packages)
Is it possible to see sql executed?
I'm using Jester to create a web-application. It connects to sqlite using db_sqlite. For debugging purposes is it possible to see sqls executed during development?
Re: Pipe operator in Nim
Well operators that are also used for line continuations have to be written like this: a |> b |> c Run