Hello!
Could someone be so kind to write a step-by-step tutorial on how to debug Nim
code in VS Code using gdb and either the C/C++ extension or the NativeDebug
extension?
Some people seem to get it running this was, but I have not been sucessful yet.
Thank you very much!
Christian
You may search for the term
borrowed pointer
The manual says: "Builtin "regions" can model lent and unique pointers".
I know of unique pointers. What is a "lent" pointer? Googling that returns
stuff like:
* "Some Pointers To The True Meaning Of Our Lenten Practices"
* "PRAYER POINTERS ยท As the season of Lent... - St. Philip's ..."
Yes, not using object of meant you were "pure"
The Nim manual mentions "the upcoming OpenCL target". Is that still a coming?
And what about [Vulkan](https://www.khronos.org/vulkan/), which seems to be
it's successor?
Okay, it's seems to be solved now.
I should've used JSON's
[getStr](https://nim-lang.org/docs/json.html#getStr,JsonNode,string) proc
instead of doing $(...).
Hey,
I'm trying to get a string interpolated. There are two values which have string
type and I'm trying to do interpolation with % operator:
import json
import strutils
var
configFile: JsonNode = parseFile("settings.json")
API_KEY: string =
`split` on `Whitespace` and `splitWhitespace` are not equivalent:
from strutils import split, splitWhitespace
let s = " a couple of \t words "
echo s.split.len# prints 9
echo s.splitWhitespace.len # prints 4
In case of leading whitespace
Yesterday I tried a very similar approach as I used for Ruby:
++
// g++ -c -lCGAL -lgmp cdt.cpp
// ar rvs cdt.a cdt.o
#include
#include
//#include
//#include
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef
Use `split` proc
proc split(s: string; seps: set[char] = Whitespace; maxsplit: int = - 1):
seq[string] {..}
to use
from strutils import split
for token in "My string when splitted".split(maxsplit = 1):
echo token
Two ways (at least):
* make it a `var openArray[]`
* use `unsafeAddr`
How do I swap the first two bytes of the openArray in the following code?
# t.nim(5, 35) Error: expression has no address
import strutils
import endians
proc num(buffer: openArray[uint8]): uint16 =
swapEndian16(addr(result), addr(buffer))
var buffer =
12 matches
Mail list logo