I followed the manual as for how to use higher-kinded concepts. I was quite
surprised when the code containing genericHead actually compiled, but returned
something I don't really get...
import future, typetraits, options
type Functor[A] = concept f
f.get is A
No, you're wrong. Iterable is ANY container that can be iterated over
(including lists, sets etc) while openArray is anything that has an array-like
memory layout, i.e. array or seq. Your code fails for containers which with
non-linear memory layout:
import lists
var li =
I've now opened a PR for this
([https://github.com/nim-lang/Nim/pull/6978](https://github.com/nim-lang/Nim/pull/6978)
). Feel free to comment on it if there is any concern.
Ubuntu isn't a rolling distro so all of its packages are usually behind. This
is more prominent for some packages like Nim because we release relatively
often and each new release has many new features.
There are many ways to get around this. Ubuntu has a concept of PPAs, but I'm
not aware of o
# I could also recommend you take a look at the research [GitHub vs BitBucket
vs
GitLab](https://www.cleveroad.com/blog/github-vs-bitbucket-vs-gitlab-developers-research)
What do you think about it?
Ah, I've found where the bug is.
If it's written there as r = r * x, it's compiled into r = (NI)(r * x); and
it's ok.
But if it's written as r *= x, it's compiled into stareq__blah-blah((&r), x);
which obviously ignores that pragma. So it must have been like r *= x; in C
code instead of stareq
And I uninstalled the 0.12 and built the 0.17.2 from the sources. It went well
and as described, so many kudos to that (although it gets a bit strange in
directory c_code, but ok, it works in the end). But that's not what I asked,
sorry. The question was if apt-get install nim was going to insta
Yeah, the manual is absolutely helpless here. Now the question stays -- how to
make these checks off in the example above.
PR submitted:
[https://github.com/nim-lang/Nim/pull/6977](https://github.com/nim-lang/Nim/pull/6977)
I use choosenim for all platforms.
[https://github.com/dom96/choosenim](https://github.com/dom96/choosenim)
> I can't see any proc to create a CountTable from any iterable so I think
> you're wrong with assigning ones
[toCountTable](https://nim-lang.org/docs/tables.html#toCountTable,openArray\[A\])
does that.
> Also, it's not just like any table, as it provides inc proc
Well, yes, but you actually h
>From the [compiler
>manual](https://nim-lang.org/docs/nimc.html#compiler-usage-command-line-switches):
\--overflowChecks:on|off \- turn int over-/underflow checks on|off
When I run this program in a usual way (nim c -r), it stops with overflow
error. How can I switch this check inside? I tried what I could find in
doc/sources, but it does not seem to work.
{.push overflowChecks: off.}
proc `^`(x,y:int):int = (var r=1;for i in 1..y:r*=x;r)
On Ubuntu, I ran
$ sudo apt-get install nim
and it installed nim ok, but it's version 0.12.0 (2015-11-02) [Linux: i386].
Isn't it a bit old? Anybody plans to upgrade it? I mean automatic no-brain
installation with apt-get install nim, w/o downloading the sources and
compiling them myself.
Tha
14 matches
Mail list logo