tesseract in nim?

2021-09-24 Thread Yardanico
Yes, you're supposed to fix those manually :)

tesseract in nim?

2021-09-24 Thread robb1e
ik, rn only 4 or 5 things are working properly, i'll fix what i need now

tesseract in nim?

2021-09-24 Thread robb1e
update: it's not working, looks like the generated file has a lot of errors in the code

tesseract in nim?

2021-09-24 Thread robb1e
it's working, thanks

Closures inside loops without capturing loop variable?

2021-09-24 Thread trisub
This was my attempt as well and I was equally surprised.

HolyC as compilation target

2021-09-24 Thread carterza
is a pretty good video about the creator of TempleOS and HolyC @Araq or for anyone else that is curious. It's a pretty sad but fascinating story I'd you've never heard of Terry Davis before or his story.

Closures inside loops without capturing loop variable?

2021-09-24 Thread Randy
This small change (addition of var j) to your original posting works.

Closures inside loops without capturing loop variable?

2021-09-24 Thread alexeypetrushin
The initial version was expected. But then I tried example below, and it was not expected. Why `let j = i` didn't captured the current value of `i`? var fns: seq[proc(): void] for i in 0..1: let j = i fns.add proc = echo j for fn in fns: fn()

Closures inside loops without capturing loop variable?

2021-09-24 Thread xigoi
See [sugar.capture](https://nim-lang.org/docs/sugar.html#capture.m%2Cvarargs%5Btyped%5D%2Cuntyped). (It seems to be broken in the Nim version I'm using, but you can manually do what it does — wrap the closure in another closure that takes the values as parameters and immediately pass them to it

Closures inside loops without capturing loop variable?

2021-09-24 Thread trisub
Oh wow, this seems like exactly what I was looking for. I will have a closer look. Thanks in advance!

Closures inside loops without capturing loop variable?

2021-09-24 Thread xigoi
In your example, that would be something like for i in 0..2: let w = (proc(i: int): auto = proc(): string = books[i].title)(i) titleReaders.add(w) Run

Closures inside loops without capturing loop variable?

2021-09-24 Thread trisub
First of all, I realize that this might go somewhat against the grain of Nim. And also it's not how I normally write code in Nim. I will start by explaining very briefly what I am doing and what's my motivation but feel free to skip to the last code example and the actual question following it.

How to get files from onchange event in karax?

2021-09-24 Thread jyapayne
Unfortunately, I think the API was not understood when the code was written for FileReader. FileReader uses an event based API, so immediately running `resultAsString` will return too quickly as the file has not been read yet. It should be rewritten to something like: nclude karax

Question about "minExponent" and "maxExponent" in module "fenv"

2021-09-24 Thread lscrd
Hi all, For a float32, we get -125 for minExponent and 128 for maxExponent. It’s a bit surprising as the whole range fo exponents is -127..128, so we would expect minExponent to be -127. If we limit to normal numbers, the whole range is -126..127. For a float64, we get -1021 and 1024 when we w

Thoughts on pure Nim api for SPI & I2C device access?

2021-09-24 Thread elcritch
> However, I also just learned that you can't create a const pointer, including > const objects that contain ptr in their fields. If your struct is all values, > then it should be OK, you can take its addr at run time. Yah that’d be a blocker. Most of these device bus structs take a pointer of

HolyC as compilation target

2021-09-24 Thread robb1e
there are some forks going on

HolyC as compilation target

2021-09-24 Thread JohnAD
Seriously though, has development started up on TempleOS? I was under the impression that everything is frozen/archived since Davis' passing.

HolyC as compilation target

2021-09-24 Thread JohnAD
I can't get Nim to properly connect to the TempleOS network drivers. Lack of documentation I think. :)

Thoughts on pure Nim api for SPI & I2C device access?

2021-09-24 Thread auxym
> I'm not sure how easy it'd be to create const's that you could ensure were > valid C structs. My understanding is that nim objects map 1:1 to C structs. c2nim always add the `{.bycopy.}` pragma, but I'm not sure why that's required. However, I also just learned that you can't create a `const`

tesseract in nim?

2021-09-24 Thread robb1e
tysm for the help, as soon as i get on the computer i will try following this

tesseract in nim?

2021-09-24 Thread mantielero
With `c2nim`, my experience goes as follows. You normally run it like this: c2nim --header capi.h Run It worked! Well, not really. For this header you get everything commented. You need to know where it fails. To know that, you should use `--strict`: $

Composition in Nim (newbie question)

2021-09-24 Thread Araq
Use `object` and learn about the `var` type parameter modifier.

Composition in Nim (newbie question)

2021-09-24 Thread EnteryName
I know that might be a newbie and abstract question, but are there any best practices to use composition with Nim? To better explain, the manual says whenever there's inheritance ref objects should be used instead of common objects. Does this happen to composition too or in general whether there

tesseract in nim?

2021-09-24 Thread Araq
> i tried with c2nim but it didn't work And when this happens, the last thing you should do is to read its manual, tinker with the C code and gain deep understanding. :P

tesseract in nim?

2021-09-24 Thread robb1e
i tried with c2nim but it didn't work

Windows shellapi ShellExecuteEx

2021-09-24 Thread Lecale
How do you go about doing this the other way around. I take it is a pretty minor change, but I have no idea where the correct reference documentation is.

tesseract in nim?

2021-09-24 Thread mantielero
The [API](https://github.com/tesseract-ocr/tesseract/blob/main/include/tesseract/capi.h) doesn't look too complex. I would recommend you to do it yourself. You will be grateful afterwards. You can look at c2nim, nimterop, futhark, cinterop. The only one that I haven't tried so far is Futhark (

How to get files from onchange event in karax?

2021-09-24 Thread sdmcallister
Trying to acutally read the file using the FileReader API. I'm using Karax but would appreciate any examples in karax or just using std/dom. I would expect that the following would work, but console.log shows null. input(`type` = "file", id = "file-input"): proc onchange(ev:

Typescript as compilation target

2021-09-24 Thread xigoi
So then you should make a Svelte plugin or something that can recognize and compile `

Nested concepts

2021-09-24 Thread shirleyquirk
leaving aside the question of whether its a good idea, here's how to get it to compile: with devel and new-style concepts: type Concept0* = concept proc copy_C0(x:Self):Self proc init_C0(x:var Self) Concept1* = concept proc copy_C1(s:Self,

Futhark: Automatic C imports in Nim using libclang

2021-09-24 Thread Araq
> I guess Futhark might not be good for all C libraries - but wouldn't it be ok > to have it for some libraries? Yes, indeed. Especially if the "C library" is actually a constantly moving target (and not much of a "library" then but I digress). Futhark looks nice for somebody's personal needs,

HolyC as compilation target

2021-09-24 Thread Araq
Well no, we will never support HolyC, whatever that is. Maybe Nim already runs on TempleOS, maybe not but we don't officially support it and I don't accept patches for adding support for it. Likewise we don't support Oberon (the OS, not the language) nor Plan 9.

HolyC as compilation target

2021-09-24 Thread robb1e
this is not a joke, we have to fulfill god's work

HolyC as compilation target

2021-09-24 Thread Araq
Ha, good one.

HolyC as compilation target

2021-09-24 Thread robb1e
i am currently using templeOS and i'm wondering if nim will ever add HolyC compilation and if nim works on templeOS