No, I haven't tried. I want to explain that I would better understand - I admit
that this is a good module, but the presence of such features out of the box in
the design of the language itself, with a guarantee from the compiler is not
the same. I liked the article on that -
Is there a way to have optional params before an untyped body in
templates/macros?
The last case gives an error, that's the one I want:
template foo(a1 = 10, a2 = "", body: untyped) = discard
# works
foo(3, "asdf"):
for a in 0..<3:
echo a
echo 10
assert (1, 2, 3) is tuple
Run
樂?
@cantanima @avandy Have you tried the
[contracts](https://github.com/Udiknedormin/NimContracts) module?
The way I shown just avoids the import/export pair :p If you have more advanced
needs (ie. import all module in a folder), then some macro magic can be used.
Got to agree regarding the language comparisons. D takes the same approach wrt
comparing itself against c++ and it just detracts from the newer languages in
comparison.
I am also a fan of Ada language. The only thing that limits my use of this
language wherever possible is essentially having a single compiler from Adacore
(gnat) and a GPL license. I have thoughts to start developing software for a
specific platform (not x86). This immediately limits the choice
> So indeed iterating over the keys and stopping after first one makes sense, I
> think there is no function to retrieve the first added element. And I think I
> can remember someone asking how to get the n-th. added element, conclusion
> was to use a loop similar as you do.
Thanks, Stefan.
Same, ecosystem, I needed to do WebRTC, and I couldn't affort to write the spec
from ground up. Just a step to Go and you have a full implementation:
[https://github.com/pion/webrtc](https://github.com/pion/webrtc)
Thanks both of you :-) Is there any advantages of using one over the other (for
bigger project perhaps)?
For me it's the same as for few others here. Stability of the ecosystem/lack of
libraries. The language itself is pretty neat though.
> it became clear that everyone had been quiet about some really serious
> problems.
I don't think people were "quiet" per say. It's just such a small community
that it took time for the problems to become apparent. It took time for
projects to become big enough or creative enough to start
@andrea I 100% agree with your first point. It is one of the main reasons I
can't use Nim as my main language, but use it as my main hobby language. The
community just needs to grow, in all senses. We need more projects, more
libraries, more users, and more marketing. These are hard things, and
Ok, yeah, we have no api for that.
Make a nim file of your choice (`testPackage/prelude.nim`), with the following
content
import testPackage / [submodule1, submodule2, submodule3]
Run
Then just `include testPackage/prelude` and all of your imports should be there.
This approach is used by Karax.
`import testPackage/submodule1 export submodule1 import testPackage/submodule2
export submodule2 import testPackage/submodule3 export submodule3 `
Run
use
iterator pairs[A, B](t: OrderedTable[A, B]): (A, B)
Run
and break-out after first (does "... in insertion order." kind of implies
FIFO?) element.
I have divided my package into submodules and would like to export their API
via the main module so all submodules can be imported by just importing
it./src|
---|---
\--- testPackage.nim --- /testPackage --- submodule1.nim ---
submodule2.nim --- submodule3.nim I have put a
I'm not trying to get sorted items, just the first item added (hence why I used
an OrderedTable).
>From your last code sample, I think I understand that you want to retrieve the
>table entry, that was added first to table. So indeed iterating over the keys
>and stopping after first one makes sense, I think there is no function to
>retrieve the first added element. And I think I can remember
There is nothing wrong with asking in two places. Please don't criticize people
for doing, or at least not in the way that you're doing it.
It would be nice if the author added a link to Reddit and vice versa, but
otherwise there is no problem in asking in both places.
I don't understand the question: An OrderedTable keeps the insertion order,
it's not a "SortedTable" (which the stdlib still lacks)
> will circular module dependencies be something that will be added to Nim?
Yes, eventually. I personally would like to have a `submodule` concept for this
so that the cycle is restricted to a set of "submodules" but the last time I
brought it up it didn't have many sympathizers...
> Nim implementation of the spec.
Oh nice @mratsim. Where is the work happening?
Typeclasses in Nim is only used for generics, meaning that they're a
compile-time constraint, not a runtime one. You'd need an object variant for
this case.
The usual way currently is to use a common "datatypes" file.
See also the current discussion to improve the status quo:
[https://forum.nim-lang.org/t/4745](https://forum.nim-lang.org/t/4745)
I'm using it as my main language but there are several reason why I don't push
it in my data science communities:
* I'd like a jupyter kernel/REPL for quick experimentation (arguably this is
possible now with hot-code reloading).
* Vtable (or working generic methods) would be very useful
I have used Nim for many small experiments, but the main reason why I am not
using Nim as my main programming language is that it is not popular enough. I
know this is circular, but where I work I am the Nim person. If anything should
go wrong on a project where Nim fails to deliver on some
28 matches
Mail list logo