2 questions on json mudule

2022-01-04 Thread oyster
thanks, everyone the json module saves a lot of typing for my case

column value extraction

2022-01-04 Thread sdmcallister
The [DuckDB C Query API](https://duckdb.org/docs/api/c/query) has two ways to extract values from a query result. One way is to use the duckdb_value_TYPE functions which take a row and col and return a value, the other, more dangerous, way is to use the duckdb_column_data function which returns

Look up proc signature from an ident

2022-01-04 Thread ElegantBeef
Odd it works on explicit generics but not implicit, here is how you'd do it import std/macros macro examine(ident: typed) = echo ident.getImpl.treeRepr # type Foo = concept f proc someProc[T: Foo](arg: T) = discard

Look up proc signature from an ident

2022-01-04 Thread Nycto
Awesome! Thank you I might be pressing my luck, but is it possible to do this with concepts, too? import macros macro examine(ident: typed) = echo ident.getImpl.repr # type Foo = concept f proc someProc(arg: Foo) = discard

Anyone written an Android app using Nim-generated Native code lately?

2022-01-04 Thread marcomq
I used android and nim version 1.4.8 But I always have issues with new Nim versions as the Android Studio / Ndk isn't cleaning up all temporary files. Maybe you can just erase all temporary files mentioned in your compile error mes

Look up proc signature from an ident

2022-01-04 Thread Nycto
If I've got a macro where I pass an `ident` as an argument, is it possible to read the signature of the proc? Here is an example of what I'm trying to do: import macros macro examine(ident: untyped) = ident.expectKind(nnkIdent) # My goal is to read t

Look up proc signature from an ident

2022-01-04 Thread ElegantBeef
import std/macros macro examine(ident: typed{sym}) = # My goal is to read the list of arguments right here, but # the following line fails with the error: "node is not a symbol" echo ident.getImpl.treeRepr # proc someProc[T](arg: T) =

tesseract in nim?

2022-01-04 Thread Zoom
> I always thought it a good idea to try to improve scanned PDFs by using the > OCR data to extract glyphs for new fonts as the average of all their > instances (maybe removing outliers to mitigate mistakes). Then you can make a > new PDF with said defined fonts that should look much higher reso

tesseract in nim?

2022-01-04 Thread cblake
If someone wants a project idea beyond the usual "search for strings", I always thought it a good idea to try to improve scanned PDFs by using the OCR data to extract glyphs for new fonts as the average of all their instances (maybe removing outliers to mitigate mistakes). Then you can make a ne

Strange problem when using Futhark

2022-01-04 Thread TKD
This code testing gsl works fine: import futhark {.passL: "-lgsl -lgslcblas".} importc: "gsl/gsl_sf_bessel.h" var x = 5.0 y = gslSfBesselJ0(x) echo "J=(", x, ") = ", y Run but oddly, this does not: import fu

Some warnings on vcc compiler, potential bugs?

2022-01-04 Thread treeform
Nim generates unreadable C code. C warnings are for human written code. It makes no sense to apply C warning meant for humans to auto generated C code. Nim already checks that the construct makes sense before passing it to C. It makes no sense to check it in C again. C warnings for Nim code are

F-bound polymorphism in C++ and(?) Nim

2022-01-04 Thread bpr
I went down a similar road not that long ago (3 years?) and found that Nim is not suited for directly expressing the "curiously recurring template pattern" as in C++, since generics and inheritance don't play well together in Nim. I was hoping, as I started reading this post, to be proven wrong.

Some warnings on vcc compiler, potential bugs?

2022-01-04 Thread 12398890
OK, belows are for summary

tesseract in nim?

2022-01-04 Thread DavideGalilei
I just finished my wrapper library for tesseract, feel free to try it out! 🎉

Some warnings on vcc compiler, potential bugs?

2022-01-04 Thread Araq
These don't look like bugs to me.

nbindgen - calling rust code from nim

2022-01-04 Thread giaco
would this work?

Anyone written an Android app using Nim-generated Native code lately?

2022-01-04 Thread cmc
@GordonBGood Do let me know if that repo works again, I'd love to try it!!! I was looking for something that worked as well as nimx but a bit more room to put your own stack together.

Some warnings on vcc compiler, potential bugs?

2022-01-04 Thread 12398890
`Use --cc:vcc --passC:"/analyze", there are some warnings, is these potential bugs? Debug build: nim-1.6.2\lib\system\io.nim(825) : warning C6031: Return value ignored: '_setmode'. nim-1.6.2\lib\system\io.nim(826) : warning C6031: Return value ignored: '_setmode'. nim-1.6.2\lib\system\io.nim(827

Anyone written an Android app using Nim-generated Native code lately?

2022-01-04 Thread Hlaaftana
On the repo of the issue you linked, there is a manually copied [nimbase.h file](https://github.com/GordonBGood/NimHelloJNI/blob/master/app/src/main/cpp/nimbase.h) from an old version of Nim compared to [the latest one](https://github.com/nim-lang/Nim/blob/3a1109a53be172a92c63ebc5bdb69c45e78e9ca

2 questions on json mudule

2022-01-04 Thread kobi
For your example: import strUtils import json var a = %*[1, "hello", nil] echo a echo "\n" for i in a.items(): echo i, " ", i.kind echo "\n" for i in a.items(): case i.kind of JInt: echo (i.getInt() +