Issue with calling a routine defined in a concept

2023-10-23 Thread ElegantBeef
Of some note: type Thing = concept t work(t) proc start(t: Thing) = mixin work t.work() work(t) # undeclared identifier Run Will make it `work` :P

Issue with calling a routine defined in a concept

2023-10-23 Thread shirleyquirk
That's a bug yep. Please report it on the github bug tracker, and thank you in advance for your service. No, rfc 168 won't make it compile, thats orthogonal.

webidl2nim - webidl to Nim bindings generator

2023-10-23 Thread ASVI
## Custom Types Now supported adding custom types (for direct translation to nim) to webidl2nim via simple dsl example: translateTypesDsl MyMapping: HTML5Canvas: import pkg/html5_canvas -> Canvas Run It can be used via addMapping proc. This i

Issue with calling a routine defined in a concept

2023-10-23 Thread SuaveSteve
type Thing = concept t work(t) proc start(t: Thing) = t.work() # work(t) # undeclared identifier Run I do not understand why Nim cannot find the declaration of `work` for the commented line. Is this a limitation of generics or Nim's

threaded updates to sequence in objects?

2023-10-23 Thread mratsim
`syncRoot` is not needed here because the first thing `exit(Weave)` does is `syncRoot` However, usually threadpools are started and exited at the very start and very end of the program because creating threads is very e

Invalid type void in a sequence in a generic object variant fails

2023-10-23 Thread choltreppe
You could do something like: type Obj*[T] = object case a*: bool of false: discard of true: when T is void: discard else: b*: seq[T] Run so the b field only exists when the type isnt bool. But in this case th

threaded updates to sequence in objects?

2023-10-23 Thread ingo
Thank you. Following @Araq 's lead I did the same to `weave` and came up with the code below. It works with both spawn and parallelFor. But it means doing away with the `var`. Is the `syncRoot` then still needed? import weave type Count = object n: int

threaded updates to sequence in objects?

2023-10-23 Thread mratsim
Here is the fixed Weave version: import weave type Count = object n: int v: int nseq: seq[int] func initCount(n, v: int): Count {.inline.} = #new(result) result.n = n result.v = v result.nseq = newSeq[int](n)

Alternative to powmod in Nim

2023-10-23 Thread mratsim
Thanks :) On that front, Constantine as being integrated to Google continuous fuzzing framework OSS-fuzz in It's quite complete as it's fuzzed for both 32-bit and 64-bit.