calling conventions differs unexpectedly

2020-08-09 Thread Araq
If you capture `cmdhdl` then your proc is a closure.

calling conventions differs unexpectedly

2020-08-09 Thread windowsboy111
Here I am with a proc: proc cmd_exit(input: string): string = cmdhdl.exit() return "exit" Run According to the [docs / manual](https://nim-lang.org/docs/manual.html#types-procedural-type), `proc` s without any calling conventions will default to `{.ni

paramCount in NimScript not working?

2020-08-09 Thread Akito
* [https://forum.nim-lang.org/t/6274](https://forum.nim-lang.org/t/6274) * [https://github.com/nim-lang/Nim/issues/12835#issuecomment-562973489](https://github.com/nim-lang/Nim/issues/12835#issuecomment-562973489) * [https://github.com/nim-lang/Nim/issues/14142](https://github.com/nim-lang/

Nim beginner series for absolute beginners

2020-08-09 Thread Cnerd
@douglas thanks for the feedback really appreciate the next videos will have a better audio setup than the previous ones that I promise

Nim beginner series for absolute beginners

2020-08-09 Thread douglas
The audio in the first video is fine. Nice and clear, a few pops here and there but is ok. The second video has terrible audio. Even with volume 100%, I can barely here you. Please go back to the setup you used in the first video.

A random number generating library

2020-08-09 Thread YesDrX
Hi, I wrote a random number generating library. [Doc]([https://yesdrx.github.io/randgen/distributions.html](https://yesdrx.github.io/randgen/distributions.html)) [Github]([https://github.com/YesDrX/randgen](https://github.com/YesDrX/randgen)) import randgen when isMainModule:

A simple bitsarray lib

2020-08-09 Thread YesDrX
Hi, I wrote a simple bits arary library, which can be applied to larger bits sets (any length) or high precision numbers. [Doc]([https://yesdrx.github.io/bitarray/](https://yesdrx.github.io/bitarray/)) [Github]([https://github.com/YesDrX/bitarray](https://github.com/YesDrX/bitarray)) # Example

call-by-value Y combinator

2020-08-09 Thread bpr
It's disappointing that Nim doesn't allow cyclic procedural types, like the one you wanted to write, but not too surprising. OCaml requires a special flag to compile types like this # type cont = int -> cont -> int list;; Error: The type abbreviation cont is cyclic

Nim website front page redesign (unofficial and WIP)

2020-08-09 Thread konradmb
Just add a new CSS rule, tune it and forget about buttons to keep those dark-siders happy 😄 [https://web.dev/prefers-color-scheme](https://web.dev/prefers-color-scheme)/ @media (prefers-color-scheme: dark) { body { color:white; background:#444 } a:link {

C# nameof() in Nim

2020-08-09 Thread Hlaaftana
Use `untyped` instead of `typed`, that will get you the template.

C# nameof() in Nim

2020-08-09 Thread doongjohn
Thanks! That's cool How about getting a template name? is it impossible?

C# nameof() in Nim

2020-08-09 Thread wltsmrz
> Also how can I disallow certain things... Standard library has [https://nim-lang.org/docs/macros.html#expectKind%2CNimNode%2CNimNodeKind](https://nim-lang.org/docs/macros.html#expectKind%2CNimNode%2CNimNodeKind) but not expect-not or expect-in. import std/macros proc exp

C# nameof() in Nim

2020-08-09 Thread doongjohn
I basically want this [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/nameof](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/nameof) I thought It would be simple (btw I have almost no knowledge of macro) macro nameof(x: typed

Nim website front page redesign (unofficial and WIP)

2020-08-09 Thread doongjohn
That's a good idea! However I've never done that before so it could take some times.

HTML template engine that keeps code/templates separate?

2020-08-09 Thread zolo
@snej I was looking for the same thing, especially something like Pug.js or Slim (a Ruby thing). Please let me know how Moustachu works for you, if you give it a try. I opted for the stdlib’s **htmlgen** module which looks quite nice, though I do have a thread asking about some ways to improve

HTML template layout

2020-08-09 Thread zolo
👋 I'm trying to come up with a way build an HTML template in the cleanest way possible. I can do: import htmlgen proc layout(view: string): string = result = head(link(rel="stylesheet", href="styles.css")) & h1("In time") & p("yo

Nim website front page redesign (unofficial and WIP)

2020-08-09 Thread jasonfi
You could make both a light and a dark mode, using a switch to choose between the two (just different CSS should work). This is what the Nim docs do and it works well. A cookie could remember the selection.