How to convert range types 'a'..'z'?

2021-09-12 Thread alexeypetrushin
How to convert range types? Expressions like `v('a'..'z')` doesn't work. [Playground](https://play.nim-lang.org/#ix=3yJ4) import sequtils type Check* = tuple priority: 'a'..'c' message: string converter to_check*(check: (char, string)): Check = (c

discard vs var _ {.global.} =

2021-09-12 Thread doongjohn
Why do these produce different assembly? these all mean the same thing, discard the result... # test1 # 154 lines of assembly proc test: int = echo "wow" 10 var _ = test() var _ = test() Run

The NaN story, short version

2021-09-12 Thread alexeypetrushin
I just discovered dangerous bug in my codebase, caused by silent `NaN`. I think this switch `--nanchecks:on` is useful and should be kept .

I'm having a Nim+Lua+Libtcod callback wrapping problem

2021-09-12 Thread Skaruts
Well, I said in my very first sentence that I'm using libtcod_nim.

Links of websites built with Karax?

2021-09-12 Thread Taufeeqmowzer01
Thanks @sdmcallister and @moigagoo.

Weave+ARC WIP or my bug?

2021-09-12 Thread Araq
Warning, untested: proc `=destroy`(x: Node) {.nodestroy.} = var it = x while it != nil: let nxt = it.next it.next = nil `=destroy`(it[]) it = nxt Run

I'm having a Nim+Lua+Libtcod callback wrapping problem

2021-09-12 Thread kobi
nimble install libtcodnim

Weave+ARC WIP or my bug?

2021-09-12 Thread ggibson
That would be fantastic for porting! In case you're curious of a user experience with ARC, I'm confused how the custom destructor should actually clear each ref object of my list. I saw some posts that showed using `dispose(node)` but it seems modern dispose is meant for inter-thread freeing on

What does ref object key return

2021-09-12 Thread EnteryName
Okay, now I think I got it, (I even tried) but when should I return this type instead of an object type?

More Nim on more Microcontrollers!? (Arm CMSIS / Zephyr RTOS)

2021-09-12 Thread auxym
Very cool for Zephyr, I've been interested in checking it out since I heard one of the devs on the Embedded.fm podcast. > Interesting, did you go with the C-struct model or use the setter/getter > pattern you discussed before? Setters/getters. For a few reasons. (1) C doesn't map closely enough

The "reset password" routine does not seem to send me a message at my e-mail address

2021-09-12 Thread Serge
1\. The "reset password" routine does not seem to send me a message at my e-mail address 2\. I checked my spam folder for messages from Nim, without sucess.

What does ref object key return

2021-09-12 Thread xigoi
When you type is declared as a `ref object`, the `ref` is a part of it, so you don't need to add it anywhere else.

What does ref object key return

2021-09-12 Thread ElegantBeef
type A = object proc x(): A = var x = A() return x var obj = x() Run Is probably what you seen `ref A` in your example was a `ref ref object` which has a second pointer indirection.

Weave+ARC WIP or my bug?

2021-09-12 Thread Araq
Fwiw we're also looking at producing non-recursive destructors automatically as it's a porting issue otherwise.