Yes, you are right, I noticed that occurs if the user does not tag the repo
too. That's why I updated my post with
> Saying that I observe an ambiguity on the term "update" for nimble packages.
> If I understood correctly a package developer registers the package with
> nim-lang/packages and stores it on github. When someone installs the package,
> files are downloaded from the github repo. Now, the ambiguit
Thanks @gemath for your thoughts. It is true that the priority is to carry Nim
to well deserved 1.0 release at the moment but I think at some point not in the
very far future, nimble should be improved and rehandled. I guess it is already
in the roadmap.
There are guidelines in nimble github pa
> On my system choosenim does, since it is Nim's toolchain manager. Not sure if
> nimble updating itself as a package is recommended.
As fas as I know, nimble does not install itself or nim, so my script does not
either. I guess it will not be a problem.
there is no official/bundle-in function/operator for ptr type, so what is the
purpose of ptr type in nimlang?
@lscrd: The `initElement` is also a setter despite its name ;). You cannot stop
users from calling `element.initElement("different id")` and mutating the field
at any point in time, which is what I'm trying to avoid.
In fact that is also true for my template constructor idea via
`newElement("di
In this direction, to make it work, you have to do a cast:
proc newElementA(): ElementA =
cast[ElementA](newElement("A"))
Run
Another way consists to create a proc _initElement_ in _lib_ :
proc initElement*(elem: Element, id: string) =
elem.id
If you want to _actually_ calculate Fibonacci numbers not use it as a (poor)
benchmark for funcalls/recursive overheads or for other purposes, then you may
also find this interesting:
[https://sahandsaba.com/five-ways-to-calculate-fibonacci-numbers-with-python-code.html](https://sahandsaba.com/f
@Stefan_Salewski: That what I meant with mutable setters ;). I'm trying to
avoid them so that user can cannot arbitrarily reset the field.
I finally had an idea that I can at least abstract away the mutation of the
field:
# in lib.nim
template newElement*(idString: string, body
I tried it once this way:
[https://forum.nim-lang.org/t/4226#26316](https://forum.nim-lang.org/t/4226#26316)
After fixing the wrong var parameter type I think it was working as expected,
but indeed we should have some lecture notes from the bright devs in a Nim
textbook, together with the syste
I'm running into this problem in every project of mine, and I simply can't find
a good solution, although the problem seems very basic.
Let's say I write a dummy `lib.nim` like this:
# The lib provides a definition of an abstract base type
# without any actual instantiations...
Was going to take care of that right now! If anyone has any suggestions, please
let me know. Next videos are probably going to be a little bit shorter, but
other than that I'm pretty happy with how the first one went.
funny, for certain things I find that the command syntax (is that what it's
called?) is quite nice. In the screencasts I make, when I call echo, I always
just do `echo x` or `echo "hello"` etc. I like command syntax for things where
the parentheses just make for visual noise. It certainly should
And since @ryukoposting didn't do it himself, I must do it for him :)
Here is his first video:
[http://ryuk.ooo/videos.html](http://ryuk.ooo/videos.html) \- very nice
presentation and explanations, I'm looking forward to the next ones!
> As I experienced myself too, whenever you ask to install the package, it
> downlods the files with the latest commit ...
nimble by default clones/checks out the current state of the default branch of
a git repository. Which branch that is is configured by the repo maintainer.
> ... , even if
Thanks for the hint!
> regarding excluding the compiler and nimble, does nimble update those?
On my system choosenim does, since it is Nim's toolchain manager. Not sure if
nimble updating itself as a package is recommended.
I know it's not the main point of this article, but use of recursion kinda
dulls the excitement of " ** _Speeding Up_** Python with Nim". Why not show the
fastest fib version, with a loop?
This runs many orders of magnitude faster. It also works for n>92 (int64
overflow). Pre-filling an initial
This does not seem to work for compilers installed via choosenim.
When I compile nim code for embedded systems using the compilers from
platformio, all I need a pointer to the location of nimbase.h. It would be
ideal if choosenim could update a symlink (or similar) in a standard place so I
don'
But this works
[https://wandbox.org/permlink/y9EYLm0EV6ULzrqS](https://wandbox.org/permlink/y9EYLm0EV6ULzrqS).
It is a conversion I'm not aware of?
Nitpick: strings are not openarray[char].
[Varargs](https://nim-lang.org/docs/manual.html#types-varargs)
> A varargs parameter is an openarray parameter that additionally allows to
> pass a variable number of arguments to a procedure. The compiler converts the
> list of arguments to an array implicitly
[Open arrays](https://nim-lang.or
22 matches
Mail list logo