shorter version
const apple {.strdefine.} = "default_value"
template toImport(x: static[string]): untyped = import x
toImport(apple & "tools")
Run
import macros
const apple {.strdefine.} = "default_value"
macro toImport(x: static[string]): untyped = quote do: import `x`
toImport(apple & "tools")
Run
nim c -d:apple=new_value myproject
Run
result = cast[ptr ITestIntf](intf) probably what you want is result = cast[ptr
ITestIntf](intf.addr).
use addr operator to get the address of a variable.
returning something on the stack is very dangerous, the time you exit/returned
from the proc, the object on the stack may be already replaced
Nim 0.19.0 images are on Docker Hub:
[https://hub.docker.com/r/nimlang/nim/tags](https://hub.docker.com/r/nimlang/nim/tags)/
yeah, this is a regression. this bug already reported on github
Once the Nim VM matures, will it ever be possible to use FFI calls? Is it a
matter of supporting FFI in the VM interpreter?
Is there a way to use a static calculated string value as the argument of an
import statement?
For example:
> import LIB&"tools"
where LIB was a defined symbol from the nim compile command - perhaps:
> nim c -d:LIB=vector myproject.nim
so that myproject.nim would import vectortools.nim
Tryin
Just getting started with Nim and experimenting with Delphi interop. I can pass
a Delphi interface reference (which is basically a pointer) into a Nim DLL and
call methods on the interface using code like this for the definition:
type
GUID* {.pure.} = object
Data1*: in
Confirming that it works for me on 0.18.0 but crashes on 0.19.0.
Nim isn't something you just quit.
A part of Nim stays in you, always.
Every missing semicolon that D smacks you for, every undefined WTFism in C++,
every second you wait for your 40mb Golang binary to upload, every time you
realize that half of your screen is taken up by repetitive boilerplate
This used to work in 0.18.0, now it crashes run-time. Could anyone please
confirm if working for them as to exclude my installation? Thanks.
import pegs
proc main =
var pg = peg"\<(\d / [a-fA-F])+\>"
let fnd = findAll("abc<5F>220<6", pg)
for f
What can they do??? Is there documentation?
It depends on what you need your plugin to do.
Digging up a dead thread, is there anybody who knows exactly what you need to
do to make a compiler plugin?
Thanks to all contributors! Great to see another release with many substantive
improvements :)
My excitement has breached the containment field.
Great job!
Great job to everyone. All the work done by lemonboy is noticeable.
Awesome! Great work!
We finally did it, thank you for all your help and feedback.
[https://nim-lang.org/blog/2018/09/26/version-0190-released.html](https://nim-lang.org/blog/2018/09/26/version-0190-released.html)
The fact that `nil` is not a thing anymore for seqs and strings is a large
breaking change so please upd
Thanks for the Link. Let me read. And yes, You are right. Strict typing is
problem. But i know, it will become easy after a few hobby projects. My
previous experience was in AutoIt. It has no types, Infact, we need types
actually. In VB.Net, we can use Object type and then later convert it when
yeah sorry, I don't use it much "typeinfo" got it
Feel free to ask on IRC then.
The only way to progress fast in Nim is by trying and then asking otherwise you
will lose time. I remember learning like throwing eggs on a wall a see what
sticks (and then raising bug reports for static and generic types).
Now from all your posts, I think the bigg
23 matches
Mail list logo