@mashigan & @miran Ty guys, you both point me to tables and i also thought that
tables would solve my problem. I thought that tableref would reference the
content like record number. But it reference the whole table. The point is that
i want to prevent to walk through the whole table to see if
thank very match.
I think, that correct path is
touch src/moje/a/a.nimble
touch src/moje/b/b.nimble
It works.
Yes, you can do this:
template withDb(body: untyped) =
let dbFut = open(...)
yield dbFut
let db = dbFut.read()
defer: close(db)
block:
body
The compiler uses a .nimble file in a similar way as Python uses the
__init__.py files. To fix your issue you can just:
touch src/moje/a.nimble
touch src/moje/b.nimble
Should work then.
Maybe I'm misunderstanding the question, but to me this looks like a case where
you would want to use [tables](https://nim-lang.org/docs/tables.html) instead
of seq.
But maybe wrapped to `TableRef` is better I guess instead of seq if you need to
have unique key
implement proc `==` and `contains` for you specialized type
import sequtils
type
DataBuffer* = tuple
key : string
mytype : string
value : string
proc `==`(a, b: DataBuffer): bool =
a.key ==
Hi all,
I have a problem finding a solution for a problem (or perhaps i am looking the
wrong direction). I want to check if a key is already set and if that is the
case, overwrite it with the new value. Off course there is the possibility to
walk through the whole sequence to see if a key
@alexsad, take a look at
[https://github.com/yglukhov/android](https://github.com/yglukhov/android)
OK, so core Nim doesn't have an arbitrary precision math capability. Is it
something planned for in the roadmap to 1.0?
thanks a lot mashingan! It is working!
Now I am going to implement JNI to call java classes(some SDK has been already
developed in Java) for manage android application.
If I have two modules with the same name in differrent directory, I get compile
error
**Error: module names need to be unique per Nimble package;**
tree
.
├── moje.nimble
├── src
│ ├── moje
│ │ ├── a
│ │ │ └── x.nim
│ │ └── b
│
Araq I checked again to see if that issue exist but now I am not able to
replicate it. It happend when I was setting up my workspace in a new linux
machine. Cant say for sure wt happened but it does work now.
@mratsim: The code needs two changes to work:
import macros
macro defthing(name: untyped): untyped =
# used this instead of parseStmt
result = quote do:
let `name` = 1000
# Now things get really weird: added a dummy argument and things work as
At Status we require that for cryptographic work and we are developing and
supporting the following:
* nim-ttmath:
[https://github.com/status-im/nim-ttmath](https://github.com/status-im/nim-ttmath).
This wraps the [ttmath C++ bignum library](https://www.ttmath.org/). This
requires the
Normally to do identifier construction of variable you need to use `{.inject.}`
However untyped macro will capture everything and you will have to deal with
the inject pragma in your macro.
Instead forget about the template and do identifier construction directly in it.
import
To add to Stephan's answer, I have tried both packages when solving puzzles
from "Euler project":
* "bigints" is pure Nim and has the best API in my opinion, but it is about
twice slower than "bignum" and has some issues (see comments in source); it is
still a work in progress.
* "bignum"
It is not Nim specific problem, you know, it is in general GUI "problem".
In my practice the best way to send some data (and when I say "data" I mean
"more than DWORD value") to UI is to save that data in some temporary container
and use "message to ui" just to say "Hi, here is some data for
Are the nimble packages bignum and bigints not good enough for you?
I think one is a wrapper, the other is pure Nim from smart Mr. Felsing.
I have Ruby/Crystal code that uses arbitrary precision integer numbers (really
BIG numbers). Looking at Nim's math libraries they don't appear to be arbitrary
precision.
Passing data prom one thread to another
Hi, I have created a process that's runing a thread that open some windows
form, now i want that other running threads from the same process will be able
to pass data to this windows form or even close it or reopen it.
The Windows form GUI is always in
Yes, that compiles, but the macro produces the code
let x = 1000
instead of the code
let xExtra = 1000
I'm trying to get the identifier to be constructed before passing it into the
macro, but I'm not sure if that's possible.
22 matches
Mail list logo