Great, thanks.
The message is misleading. "result" is the one at line 325 in system.nim, i.e.
the HSlice which is returned by the proc.
When instanciating the slice (".."), the fields "a" and "b" of "result" (a
slice) should be initialized with 0. But "b" is of type "range[8..10] and
cannot be initialized wit
> Or does the text here mean to distinguish beween what is merely in the
> language and what the STL adds?
Yep :)
Thanks for the pointer. I adapted the example like this:
const DIGITS = "0123456789"
proc parseInt(s : string, radix: range[8..10]) : uint64 =
var str = s
result = 0
for i in 0 .. str.high:
let c = str[i]
assert c in DIGITS[0 ..< radi
On p. 11 of "Nim in Action" one finds the following:
> C and C++ both require you to manually manage memory, carefully ensuring that
> what you allocate is deallocated since it's no longer needed.
It is true that if all you do is use plain C pointers then yes, you must manage
memory carefully.
Not in the standard library. Example implementation here
[https://rosettacode.org/wiki/Non-decimal_radices/Convert#Nim](https://rosettacode.org/wiki/Non-decimal_radices/Convert#Nim)
Something like this:
import options, strutils
from sequtils import map
proc queryStr(query: string, args: varargs[Option[string]]):
(string, seq[string]) =
## Transform '?' in query string according to optioned arguments given
if '?' notin query:
You need to install a package that provides the libcsfml DLLs. How to install
this depends on your linux distro. For Ubuntu: `apt install libcsfml-dev` (This
is a guess)
Hi! I'm junior in nim. I'm want to create games on nim. But how can i do it?
I'm found this:
[https://github.com/oprypin/nim-csfml](https://github.com/oprypin/nim-csfml) I
tried to compile it, but after compiling i'm cant open the sfml window.
tbutton@tbutton-P85-D3:~/Рабочий стол/nim-csfml-mas