Re: Why does the this code work?

2020-02-15 Thread Stefan_Salewski
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?

2020-02-15 Thread sigmapie8
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?

2020-02-15 Thread dawkot
Why shouldn't it 樂? The implicit conversion to a varargs/openarray (same thing) 
is cheap.


Re: In love with Nim

2020-02-15 Thread wintonmc
Jjajajaj thanks.


Why does the this code work?

2020-02-15 Thread sigmapie8

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

2020-02-15 Thread schmidh
Hi Andreas, thanks for the clarification!


Re: What's the difference between varargs[T] and openArray[T]?

2020-02-15 Thread Stefan_Salewski
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]?

2020-02-15 Thread sigmapie8
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?

2020-02-15 Thread Yardanico
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?

2020-02-15 Thread moigagoo
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

2020-02-15 Thread aredirect
because of ufcs you can use . e.g a.echo


Re: Is it possible to see sql executed?

2020-02-15 Thread dawkot
You should be able to just 


echo string(theQuery)


Run


Re: please advise: threading/GC - how make it work?

2020-02-15 Thread Hlaaftana
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?

2020-02-15 Thread jjude
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

2020-02-15 Thread Araq
Well operators that are also used for line continuations have to be written 
like this:


a |>
  b |>
  c


Run