You can simply use `uint` (or `int`) instead which works with every Nim version.
Yes, @Hendrik, Nimlime uses the nim that is installed and on your PATH.
Hi e,
Well what I wanted was the latest version of NIM in ST. But I believe it might
be my lack of understanding on how Nimline works. For instance, I thought that
Nimline includes a version of NIM that it runs but it seems from what you are
saying is that it alows you to use NIM in any version
Thanks @mratsim \-- I'll use your `weight = V(1)` suggestion.
I'm sorry you had to fill in missing bits... the failing code is
[here](https://github.com/dcurrie/AdventOfCode/tree/master/Utils)
It fails if you uncomment the test case in `dijktra.nim` and try `nim c -r
dijktra.nim`
Iirc the gcsafe requirement was made so that it would not be breaking in the
future to make async threadsafe.
> as it both leaves the div keyword to be used for a different purpose that is
> more appropriate and necessary
Maybe for you, but I think division is a necessary operation.
Besides div is not a keyword, you can overload it:
proc `div`(body: string): string =
"\n" &
"
Approximate fields setter and getter with JsonNode and some experimental
dooperator magic (from
[https://forum.nim-lang.org/t/5000#31345](https://forum.nim-lang.org/t/5000#31345)
and
[https://github.com/status-im/nim-cookbook/blob/master/dynamic_approximating_dynamic_types.nim](https://github.c
The example is missing a bit of proc for reproduction but this compiles for me
(though it segfaults at runtime after).
import sets, tables, hashes
type
DEdge*[K, V] = ref object
fm*: DNode[K]
to*: DNode[K]
weight*: V
DNode*[K, V] =
The proc that now accepts csize_t instead of csize should have a deprecated
overload to ease the transition (or a converter but converters tend to create
hidden bugs in my opinion)
We have a demo chat app using NimQML.
However, I think most of us had issues with DOtherside compilation at one point
or another. Also it hasn't been tested for a while but we pinned all
dependencies via submodules including the Nim compiler so it should be OK.
Now about the app, it's a Nim pro
Created an issue [on Github](https://github.com/nim-lang/Nim/issues/12813)
Thanks Araq. Just to explain: I'm reading a user provided histogram, which is
by right a CountTable, but I need to delete certain keys post ingestion. Since
CountTable doesn't provide a del() I had to resort to setting the key to 0,
which surfaced the bug above.
Sounds like a bug to me but a count table is for counting. Setting a value to 0
is not counting, you're doing something else, use an ordinary table.
With a `type` that depends on two generic typevars, the type inference
implementation seems to get stuck on a particular binding of the second typevar
based on the first... is that expected?
Specifically, for these two sections:
var w = DGraph[int,int]()
let _ = w.add_edges(@[(
I would like to showcase the potential of my nimqml bindings. Abu idea for a
possibile usefull app? Yet another to do list?
[Nimlime](https://github.com/Varriount/NimLime) works for me, at least for
syntax(-error) highlighting and jump to definition. It has not been updated for
about a year, but I've had no issues, though there are some listed on github.
What trouble are you having?
The problem is actually choose which one, they all look cool in its own way. 🤪
I am trying to make a UI based tool that use Figma to draw the UIs. Idea is
that you draw your UI in Figma and export it to run with Fidget:
[https://github.com/treeform/fidget](https://github.com/treeform/fidget) . I
hope to target HTML, Win, Mac, Linux, Android and iOS.
Thank you all for the friendly and very encouraging responses.
Congratulations,also, to the developers for your recent 1.0 achievement! I
expect I would have looked at Nim before now (as all I've ever heard about the
effort has been good) but there's typically a huge gap between alpha and 1.0,
Hi all,
new forum member here. Please be forgiving.
I think I discovered an inconsistency in CountTable. I couldn't find a way to
delete a key (no del() implementation?!), so instead I set its value to 0 as
recommended in [this Stackoverflow
Post](https://stackoverflow.com/questions/59160984/r
> Has there been any thought of adapting it to self-reflectively work with Nim?
Well, I had played with this idea a bit. Then I've realized I cant reconcile
their exceptions. I had to wrap all inter-calls with expensive try-except
blocks or your program will crash at first run-away exception.
You might want something like this:
import macros
type Foo = object
a: int
b: string
macro getFields(x: typed): untyped =
let impl = getImpl(x)
let objFields = impl[2][2] # 2 is nnkObjectTy, 2 2 is nnkRecList
expectKind objFields, nnkRec
https://nim-lang.github.io/Nim/iterators.html#fieldPairs.i%2CT
@SolitudeSF \-- My understanding is `fieldPairs` only works on instances of a
type, not on the`` typedesc`` itself.
`fieldPairs(Foo)` yields a type mismatch.
Still on my journey to understand macros and the Nim AST...
Is there an easy way to get the fields of an object type at **compile time** in
a macro? Or do I need to write another macro to walk the AST myself?
For example, given:
type Foo = object
a: int
b: string
With a fresh Nim devel I am getting
Hint: glib [Processing]
/home/stefan/gintrotest/tests/glib.nim(68, 13) Warning: use `csize_t`
instead; csize is deprecated [Deprecated]
/home/stefan/gintrotest/tests/glib.nim(69, 12) Warning: use `csize_t`
instead; csize is deprecated [Dep
Thanks for your advice.
The command succeeded after updating nim.
`nimble check` checks your package to see if its Ok. Run the command again.
Check that you are using Nim `1.0.4`.
[https://github.com/Yardanico/nimpylib#nimpylib](https://github.com/Yardanico/nimpylib#nimpylib)
already has that.
Hi. I am beginner of nim and english.
I ran
nimble publish
Run
and then an error has occurred.
Pushing to remote of fork.
Info Creating PR
httpclient.nim(271) httpError
Error: unhandled exception: Connection was closed before ful
So learn some Nim before complaining:
template `//`(a, b: untyped) : untyped = a div b
Run
I couldn't copy Python's design because back then Python only had `/` and it
sucked so I had to copy a different design.
Ok, please ignore what I said. :D
Theres UI Builder. NimQML can use the tools for Qt5 too.
I recently try all the most popular GUI libs on Nimble, they all had updates <1
year, they all work and compile a Hello World or Example GUI provided.
NimX is great is fast and compiles to lots of platforms, has a YAML like DSL,
GPU rende
I tried the Nim Godot bindings and they compiled like >=2 month ago.
Blender uses Python so using it from Nim should be doable with Nimpy.
Thank you, that explanation makes sense regarding {.threadvar.} however I am
now confused as to why I need to worry about it at all. I am using **async**
http server which I am assuming is concurrent (single threaded), so everything
should be running in the same thread. This would explain why th
> Nim-based Delphi-like IDE?
There is
[https://github.com/ba0f3/uibuilder.nim](https://github.com/ba0f3/uibuilder.nim)
\-- but I am not sure what it really is about and it seems its author has
retired.
And you can of course use [https://glade.gnome.org](https://glade.gnome.org)/
to build GTK
First year of AoC and first year of Nim too. Each part I usually take 2 hours
so I need dedicate 4 hours each day to finish it.
[https://github.com/me7/AdventOfCode](https://github.com/me7/AdventOfCode)
Looking at other people code once I've done it is my favorite part. I've learn
what's my mis
The Threadvar pragma, as its name explains, marks the variable as a thread
variable, then each thread you create will have its own copy of that variable,
thus, even if you error has dissapeared, you will find that if you modify that
variable in your thread A, and you then read it in your thread
There are existing bindings (maybe they are outdated)
[https://github.com/pragmagic/godot-nim](https://github.com/pragmagic/godot-nim)
We had example code showing how to import the produced object files into a
Lazarus project, this code later got removed as we have to ensure our examples
continue to work. ;-) But it's definitely possible to do that but then you have
the usual problems of mixing languages: FPC's strings are not
Hey awesome didn't know that about Godot!
I will ask them maybe someone would be interested thanks for the reply.
Hi, I'm working with asynchttpserver and I found that I can not access global
variables from within the server callback.
This seems to be because the server requires a {.gcsafe.} callback, and if a
global variable (in this case a table) is accessed from within the callback it
is no longer gc sa
What is referred to here as integer division is also known as floor division.
The Python language offers normal division that returns a floating point number
through the / operator and integer/floor division through the // operator.
I find this much more elegant, as it both leaves the div keywor
43 matches
Mail list logo