Uncle Bob - one syntax to rule them all?

2020-06-01 Thread rbucker
After watching Uncle "Bob" Martin lectures for hours I was left with one nagging thought. If we would benefit from one programming language why do we have so many? AND where do we go from here? He does talk about different models like procedural, structured and functional programming languages

Re: Can the nim compiler run in the browser? Experimenting Nim to template web pages

2020-06-01 Thread mildred
I just finished implementing two-way binding, and I'm using macros to generate automatic getters and setters for arbitrary datasets (setters with the ability to update the whole template on parts that changed only) Also, compared to what i did originally, it can now template any arbitrary

Re: Can the nim compiler run in the browser? Experimenting Nim to template web pages

2020-06-01 Thread exelotl
This is looking absolutely stellar! Have really wanted something like this, was thinking of making my own but didn't know where to start. I'm definitely gonna try this out :)

Editing single input line

2020-06-01 Thread Mice
Hey! I'm writing a CLI. Getting input with `readLineFromStdin()` from `rdstdin` works fine. (except: when deleting with backspace, unicode characters are not removed entirely, but it's not a big problem) I'd like to implement an edit functionality, i.e. `readLineFromStdin()` but with a

Re: raise error using zig as cross compile

2020-06-01 Thread Yardanico
"undefined behaviour" in Nim's default GC is "by design" too - [https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_common.nim#L383](https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_common.nim#L383) /home/dian/.nim/lib/system/gc_common.nim:387:50: runtime error: load of

Re: Can I "prune" directories with walkDirRect?

2020-06-01 Thread timothee
see also walkDirRecFilter since [https://github.com/nim-lang/Nim/pull/14501](https://github.com/nim-lang/Nim/pull/14501) but for now it's internal use only until API is deemed good

Properly returning an Option of a Ref type

2020-06-01 Thread adnan
Hello. I know that when a type is of `ref`, you need to construct it with `new(return)` within a function. However how does one construct the type that's wrapped inside an Option? type Tree*[T] = ref object of RootObj item: T parent, left, right:

How to properly construct a ref type inside Option in functions?

2020-06-01 Thread adnan
Hello, I know in a function returning a ref type, I need to construct the result first: `new(result)` However what if the result is an Option type? I need to construct what's inside before wrapping it inside an option. How can I do this? Example code: type Tree*[T] = ref