How to use external packages from the test directory

2021-08-21 Thread walkre
Hi, Nim community! Now I wanna use an external package in the test directory. For example like the below code: import unittest import epackage # an external package suite "a suite": test "a test": check: someProcedure() # a procedure in epackage

how are generics instantiated across module boundaries?

2021-08-21 Thread solo989
try this: proc dostuff*[T](x: T) = mixin impl echo "Calling: ", impl(x) Run mixin forces the symbol impl to be open otherwise the only symbol that dostuff can possibly use is the one defined before dostuff the default for symbols is mixin if two or more

Nim stability problem, change imports slightly, and you program is broken

2021-08-21 Thread alexeypetrushin
Finally, isolated the problem, [playground](https://play.nim-lang.org/#ix=3wBS) import std/[json, jsonutils, strformat] type SEC* = tuple symbol: string exchange: string currency: string proc somefn*(sec:SEC) = discard sec.to_json

Convex Hull in Nimrod?

2021-08-21 Thread Stefan_Salewski
But where is the link to your own published research paper? Or links to used papers? It is funny that you used the famous halve edge data structure. I used that one too for my fully dynamic constrained delaunay triangulation, but initially that halve edge ops damaged my brain.

how are generics instantiated across module boundaries?

2021-08-21 Thread ghostynewt
I'm trying to understand how generics are instantiated; I figured they would let me separate the generic declaration with a specified implementation in a different module, but it seems they don't work that way in practice. I'm trying to build an MCTS library that doesn't rely on specific details

recursive function not working

2021-08-21 Thread Araq
There is "Styling with RST is supported" and it links to

Nim stability problem, change imports slightly, and you program is broken

2021-08-21 Thread Araq
Create a minimal example and report it on github please. It's hard to tell otherwise why you have this bug. There is also fwiw.

recursive function not working

2021-08-21 Thread Kalbhairab
thanks. where is the tutorial to write rst in nim forum.

recursive function not working

2021-08-21 Thread Kalbhairab
i wrote fib program in js code:javascript const fib = (n) => { if (n <=2) return 1; return fib(n-1)+fib (n-2); } console.log (fib (50)) **_12586269025_** it worked but code in nim dont work proc fib (n:int):int = if (n <= 2): 1 else: fib(n -1) + fib (n-2) echo fib(50) it didnt work but fib

recursive function not working

2021-08-21 Thread haxscramper
You nim code worked perfectly fine for me, while js one managed to brick my browser for a minute so ... Considering you want to do recursive fib, I suggest you compile with `-d:release` and `--opt:speed` \- `nim r -d:release --opt:speed fib.nim` proc fib(n: int): int = if (n

How to make Nim more popular

2021-08-21 Thread cblake
@martin \- fun article by the man himself. I always like those retrospectives. I would take issue with the claim that his Modula-[23] -> Oberon was the first transition like that, though. Lisp dropping [M-expressions](https://en.wikipedia.org/wiki/M-expression) was probably an even more dramati

Nim stability problem, change imports slightly, and you program is broken

2021-08-21 Thread alexeypetrushin
Slightly change in imports, like importing totally unrelated Nim module, may break your program. And it happens silently, so you won't notice it. As far as I understand why it works that way, is related to how Nim symbol overload works, I already discussed it [in another thread](https://forum.n

How to make Nim more popular

2021-08-21 Thread martin
Had python hit the spot, there would be no need for nim, right? >From the horses mouth: . However, no new features were introduced except type >extension. Thereby for the first time a language was created that was not more >complex, but rather simpler, yet even more powerful than its ancestor. A

How to make Nim more popular

2021-08-21 Thread cblake
FWIW, that PEP @xflywind links to is "draft only" not accepted and has not been updated in over 2 years during which the Python version bumps for all removals have come & gone. It seems basically defunct/rejected by atrophy lest people needlessly worry about their old Py CGIs failing. That PEP

Convex Hull in Nimrod?

2021-08-21 Thread rforcen
just added a 3d convex hull pure nim implementation w/ adjacent faces, perfect for waterman polyhedron drawing, includes a opengl interface