hello, I am author of SpaceVim, and SpaceVim is a community-driven vim
distribution. SpaceVim is a project which is just like spacemacs, use layer to
manager plugins and config. we just add new layer lang#nim which provides nim
support in SpaceVim.
<[https://spacevim.org/layers/lang/nim/](https
The webpage is loading very slow in my end, any idea?
I'm using vim currently but will try SpaceVim. Thank you
https://nim-lang.org/docs/manual.html#procedures-anonymous-procs
@Stefan_Salewski, to further clarify, you could replace that code with the
equivalent:
proc onDestroy(p: pointer) =
let x = cast[var T](p)
`=destroy`(x.le)
`=destroy`(x.ri)
dealloc(p)
proc `=destroy`(x: var T) =
lazyDestroy(cast[pointer](x), onD
Ah yes, I see. Thanks!
I bet he only forgot about that.
I usually limit myself of not using parenthesis when the proc only need one
argument, while when writing anonymous proc in parenthesis entirely e.g.
(proc), thankfully it didn't parsed as a single element tuple, (or did it?
:/ )
Which Nim plugins are being installed as part of this layer? Does auto
completion and linting work?
Hello,
> Is it possible to develop full web applications (e-commerce, cms etc) with
> Nim and h2o ([https://h2o.examp1e.net/](https://h2o.examp1e.net/)) ? My aim
> is to build a tech stack mainly focused on speed. I would be really glad if
> someone points me in the right direction.
You can ch
The "compiling..." string does not appear when compiling this program:
when nimvm:
echo "compiling..."
else:
echo "running..."
Run
you need to put the echo in a static block so it's run at compile time:
when nimvm:
static:
echo "compiling..."
else:
echo "running..."
Run
So this is expected nimvm behavior? I thought it would operate like static.
This works as I expect:
static:
echo "compiling"
echo "running"
Run
Not a network hiccup by the look of it. I can reproduce the problem. choosenim
works fine as root, but not as a non-root user. Something funky going on with
installed on Ubuntu...?
How do you gracefully stop the compiler? You can specify garbage to stop it,
but is there a better way?
static:
echo "compiling..."
proc display[T](message: T) =
when not (T is string):
compile error: "T is not a string"
echo message
displa
The answer to my question in another thread lead to the answer to this one.
Replace the "compile error" line with:
static:
doAssert(false, "T is not a string")
Run
The the doAssert will run at compile time.
i would think that nimvm being true means that the vm is running that section
of code. static blocks don't tell you anything about your code except that it
run at compile time instead of normal run time.
`static: echo "compiling..." proc display[T](message: T) = when not (T is
string): {.fatal: "T is not a string".} echo message # works
display[string]("hello") # fatal error, compilation aborted # display[int](5) `
Run
16 matches
Mail list logo