Fidgetty Widget System: Rewrite

2022-09-19 Thread catswhiskers
Great thanks. I live in hope :)

Fidgetty Widget System: Rewrite

2022-09-19 Thread elcritch
Thanks for posting the details. My linux installs use x11 so I cant test it. I'll add an issue or note for others regarding the wayland issue. Hopefully it's something that can get fixed upstream.

Custom macro inserts macro help

2022-09-19 Thread CircArgs
Thanks for showing me not only the tools to see the issue but also the solution! I spotted `dumpAstGen` as well which I think will help me avoid similar problems in the future

How to get cursor position?

2022-09-19 Thread cagyul
I would like to offer the following code ,which I modified from a previous post a few years ago my apologies to the original poster). This is far from elegant or efficient, but it does the job. import terminal type Cursor* = tuple[x,y: int] # for the getcursorpos procedure var cursor*: Cursor

Return multiple "flat" nodes from a macro

2022-09-19 Thread Hlaaftana
This is possible in the development branch, in fact [it's a test](https://github.com/nim-lang/Nim/blob/7a756bfaef29ff521059b3310b67a0344001f5fd/tests/pragmas/ttypedef_macro.nim#L34-L66). You just have to return `nnkTypeSection` instead of `nnkTypeDef`.

Return multiple "flat" nodes from a macro

2022-09-19 Thread Hlaaftana
You can't do it with a normal `@[]` literal, but you can make a macro taking advantage of tuple elements having different types. import std/macros template flattener {.pragma.} proc doFlatten[T: tuple](x: T{nkTupleConstr}): T {.flattener.} = x macro manyItems: u

Return multiple "flat" nodes from a macro

2022-09-19 Thread xigoi
Unfortunately, I don't think there is a way to do this. I wish there was. It would allow for things like this: type Node {.variant.} = ref object case kind: NodeKind # the NodeKind type will be automatically generated of nkRoot: left, right: Node of nkLeaf

Return multiple "flat" nodes from a macro

2022-09-19 Thread auxym
This might be entirely misguided as I'm new to writing macros, but, is there a way to return many nodes from a macro, instead of a "tree" with a single root node? For example, consider the following: import std/macros macro manyItems: untyped = newLit(78) le

Fidgetty Widget System: Rewrite

2022-09-19 Thread catswhiskers
Well that was fun. Not. This on void linux. Installed wayland-dev. Then a whole series of complaints about missing xdg*h protocol files. Git cloned the repository then: history | grep client-header| grep wayland-scanner | sed "s/.*wayland/wayland/" wayland-xdg-shell-client-prot

Hot reload & Alternatives - Mac Support (ARM and x86)

2022-09-19 Thread carterza
Another problem you're going to run into is preserving state across DLL reloads. I also show how to deal with this in my old project's repo.

Enum union type and "Kind" pattern in recursive types

2022-09-19 Thread dlesnoff
I wanted to say « concepts » instead of « constraints ». P.S. : (I created a second account for my mobile phone, sorry if that is a problem).

Fidgetty Widget System: Rewrite

2022-09-19 Thread catswhiskers
Thanks ElegantBeef, guibar both. I'll get down to this this evening (local time)

Get a pointer to a ref object and hold on to it

2022-09-19 Thread drkameleon
@Araq Thanks a lot for the clarification!

Get a pointer to a ref object and hold on to it

2022-09-19 Thread Araq
`GC_ref` and `GC_unref` keep working with `--mm:orc` and are what you need.

Hashsets and OpenArrays

2022-09-19 Thread Zoom
>From your description it looks like the list of cities you need to work on is >permanent and you process it only when you already have the full list of all >cities at your disposal. I think the most logical way is to first collect the list in a set, then convert a set to a sequence (using the

Hashsets and OpenArrays

2022-09-19 Thread Zoom
BTW, as December is not so far away, here's a reminder that we have a special Advent of Code Nim room on Matrix: [#nim-aoc:matrix.org](https://matrix.to/#/#nim-aoc:matrix.org). You can ask questions regarding specific tasks there any time.

Hashsets and OpenArrays

2022-09-19 Thread pg13
My use case was Advent of Code 2015 where I have a list of cities to create a route through and I wanted my list of cities to be a hashset (to avoid duplicates) and then permutate all the possible options to calculate distance. >From your response, I understand by definition the hashset can't be

Hashsets and OpenArrays

2022-09-19 Thread Zoom
Set is an unordered collection (of distinct entities) by definition, and permutation is a sequence of a set, so to get the _next_ one you need some starting one. Moreover, `nextPermutation` accepts not just an openArray, but `var openArray` which means it works in-place. Choosing between your t

NimConf 2022 - registrations

2022-09-19 Thread miran
The registrations are now closed. I have send an email to all the authors. If you haven't received it, please let me know. (I have one one undelivered mail to the address `___@.xyz`; all the others should be delivered)

Hashsets and OpenArrays

2022-09-19 Thread pg13
I want to pass a hashset to std/algorithm's nextPermutation and can't because nextPermutation accepts an OpenArray (an array or sequence), but not a hashset. Are my options then: * copy my hashset into a sequence for use with other std/procs that require OpenArray's, or, * don't use hashset

Get a pointer to a ref object and hold on to it

2022-09-19 Thread drkameleon
So, the question is: let's say I have a `ref object` type (which may contain from simple types - ints, bools, etc - to more complicated ones, seqs, strings, or even references to the `ref object` in question itself). See here for example: How do I get th

Fidgetty Widget System: Rewrite

2022-09-19 Thread guibar
By default staticglfw targets X11, you need to use the switch `-d:wayland`.

Fidgetty Widget System: Rewrite

2022-09-19 Thread ElegantBeef
It works on Wayland but it needs X dev packages since it isnt a Wayland specific binary it supports Wayland and X.

Fidgetty Widget System: Rewrite

2022-09-19 Thread catswhiskers
Yep that's better, done from nimble install. Unfortunately I can't take it further since staticglfw is looking for XWindows headers. I guess the build was expecting an X window system. I'm using wayland :) and have no intention of going back to X. But thanks.