\suggestions on handling \destructuring of array/seq into a list of named fields?

2023-08-15 Thread alexeypetrushin
It's not possible.

\suggestions on handling \destructuring of array/seq into a list of named fields?

2023-08-15 Thread cblake
This might get you started: import std/macros macro toLets[T](vals: openArray[T], vars: varargs[untyped]): untyped = result = newStmtList() for i, v in vars: # change| to const or var result.add(quote do: (let `v` = `vals`[`i`])) var fieldList = [

\suggestions on handling \destructuring of array/seq into a list of named fields?

2023-08-15 Thread Araq
Use a macro.

\suggestions on handling \destructuring of array/seq into a list of named fields?

2023-08-15 Thread DMisener
# Considering: # Any suggestions on handling common problem destructuring of # array/seq into a list of named fields? # (This is quite common when parsing CSV's and the like) import strutils var first, last, phone: string # usually many more fields

Exceptions occurring in top level statements of submodule not being reported/handled

2023-08-15 Thread miran
> pray that one day I might [...] do some magnificent work. That day is already here! Everybody who follows Nim's Github repo can confirm that. I'll be free to speak in their names too, and say: Thanks for all the magnificent work so far and for all future stuff yet to come!

Malebogia

2023-08-15 Thread Araq
> but the first thing that comes to my mind is a gym locker, which I suppose > still works in this context. That was the intended pun. :-)

Malebogia

2023-08-15 Thread bpr
Naming nit: why not `Locked[T]`? PS: I loves overloading too, but the first thing that comes to my mind is a gym locker, which I suppose still works in this context.

Malebogia

2023-08-15 Thread Araq
You have to watch out with `ref`, as usual. Wrap `ref` in an `Isolated[T]` or be careful and move them into the `Locker[T]`.

Exceptions occurring in top level statements of submodule not being reported/handled

2023-08-15 Thread ringabout
杨意不逢,抚凌云而自惜;钟期既遇,奏流水以何惭? I kept being a half-assed loser and never stuck to something interesting longer than months. Thus, I'm grateful to find the Nim language, which I can pour my heart into, where I found dozens of passionate and great people among whom @araq and @timotheecour have helped m

SnelInstaller

2023-08-15 Thread Hobbyman
I have created SnelInstaller, for all you installation-services :-) For some anyway. It could take away some boring repetetive packaging tasks.. It may be still a little rough around the edges, though.

Exceptions occurring in top level statements of submodule not being reported/handled

2023-08-15 Thread termer
@ringabout 的努力真太神奇了

[Scala background] How does a macro in Scala differs from macro in Nim?

2023-08-15 Thread hamidrb80
beef has [micros](https://nimble.directory/pkg/micros)

Malebogia

2023-08-15 Thread PMunch
Very nice! This pattern looks much better than previous efforts. Are there any limitations as to what can get put into these `Locker` types? A `CountTable[string]` makes me hope there aren't many, should be able to do pretty much anything if it can handle strings and dynamically allocated memory

Malebogia

2023-08-15 Thread Araq
Check this out: