Nim Design Patterns?

2021-02-14 Thread xigoi
> for example, "hash function" or "hash table" or "lexicographical stable sort" > or "gossip protocol" Those are not design patterns, just… programming terms. > Concrete, specific versions may be implemented, That's implied by the word “implement”. Of course you can't implement something abstr

Temporal folder

2021-02-14 Thread timothee
> Is it good enough for windows/linux usage? you can upvote

How to port this c-enum to nim?

2021-02-14 Thread icedquinn
if the C enum does not cleanly fit to a nim enum, then i give up and use a distinct type while values of that enum are members of the distinct type.

Temporal folder

2021-02-14 Thread cblake
If unix-only works for you then you can just call `mkdtemp` from `stdlib.h`: import os proc mkdtemp*(tmpl: cstring): cstring {.header:"stdlib.h".} let tmp = getEnv("TMPDIR", "/tmp") let tdir = mkdtemp(tmp & "/myApp-XX"); echo tdir Run

Nim Design Patterns?

2021-02-14 Thread cumulonimbus
I think a common name for a concept, one that's descriptive (NOT prescriptive), is very useful - for example, "hash function" or "hash table" or "lexicographical stable sort" or "gossip protocol" are extremely useful for human communication and documentation. They cannot be implemented as macro

Temporal folder

2021-02-14 Thread shirleyquirk
what about the library mentioned in that issue? since the proposed resolution was to include it into fusion, i'd give that a go.

Forwarding modules via `export`, and how to structure my library?

2021-02-14 Thread SolitudeSF
in my opinion 1st solution is fine and overhead isnt that big. > you have to learn where everything comes from and constantly scroll up to > edit the list at the top of the file. you will learn where stuff is anyway when you're reaching for docs and you dont have to edit imports constantly. not

Temporal folder

2021-02-14 Thread mantielero
I need to create a temporary folder and the first result when I google is this [issue 9372](https://github.com/nim-lang/Nim/issues/9372) that refers to the [Please do not use this](https://nim-lang.org/docs/os.html#getTempDir) note. Is it good enough for windows/linux usage? Should I use somethi

Forwarding modules via `export`, and how to structure my library?

2021-02-14 Thread exelotl
Hi all! I'm trying to remove some prefixes from the names of procedures in my GBA library. Currently a "hello world" program looks like this: import natu irqInit() irqEnable(II_VBLANK) tteInitChr4cDefault(bgnr = 0, initBgCnt(cbb = 0, sbb = 31)) tteWrite("H

AsyncSocket timeout

2021-02-14 Thread benob
Thanks, exactly what I was looking for.

AsyncSocket timeout

2021-02-14 Thread Yardanico
:)

AsyncSocket timeout

2021-02-14 Thread benob
Is there an easy way to set timeouts with asyncsockets? I found this discussion but the approach is rather convoluted: