Re: Is allowing non-matching types for assignment overloading in the development timeline?

2019-04-13 Thread Araq
Overloading of `=` is in devel but the signature always must be `= (dest: var T; source: T)` and it cannot be used to introduce new implicit conversions, for that you have to use a `converter`. There are currently no plans to change this, sorry.

Re: Is allowing non-matching types for assignment overloading in the development timeline?

2019-04-13 Thread mashingan
Perhaps like this type IntAp = object setInts: array[0 .. 2, int] converter toIntAp(n: int): IntAp = let ints = [n, 0, 0] IntAp(setInts: ints) let n: IntAp = 5 Run

Is allowing non-matching types for assignment overloading in the development timeline?

2019-04-13 Thread JohnAD
If, for example, I were wanting to create a crazy new int type that stored its value as product of primes, and I was not concerned with performance, I could create my own pure nim type in a library. type intAP = object setOfPrimes: array[0..50, int] Run

Re: OpenWL/DL - two foundation libraries for building a cross-platform GUI with non-C++ languages

2019-04-13 Thread dewf
And no plans for mobile, probably ever. They are way too different, architecturally, from the windowing systems I'm building on top of. I'm a dinosaur, and I love oldschool desktop GUIs, and pretty much loathe all things mobile. Basically I'm 20 years too late to be doing what I'm doing. It suck

Re: OpenWL/DL - two foundation libraries for building a cross-platform GUI with non-C++ languages

2019-04-13 Thread dewf
Maybe there's a confusion of terminology here. The line of code you highlighted in my win32 runloop is a blocking waiting-for-event call, not polling. Polling would be checking something and returning more or less immediately every time - like sampling the buttons / d-pad on a joystick, or check

Re: Con/IO terminal library for dummies

2019-04-13 Thread Aiesha_Nazarothi
Well, async input is quite possible (through _kbhit_ ) for next version. Added to my TODO. (and no, I only love deltas since deltas are cool)

Re: Some more fun with finalizers

2019-04-13 Thread jcosborn
Is there a reason finalizers need to be set in `new` as opposed to following destructors? proc `=finalize`(x: T) = ... Run

Re: Con/IO terminal library for dummies

2019-04-13 Thread treeform
Wow you really like unicode variable names. Can this read a char without blocking (needed for a console chat app, console auto complete or console games)?

Re: nimpretty non installed by choosenim stable

2019-04-13 Thread moigagoo
What glibc version is required? Should both Linux and Windows versions be built with it?

Re: How to immutably initialize parent object with private fields?

2019-04-13 Thread bluenote
@Araq: Great to hear that there is some activity regarding write tracking, my most anticipated Nim feature ;). I think this is an independent problem though, that rather relates to object construction / initialization, not really related to immutability (my title was misleading). I'm not sure i

Re: OpenWL/DL - two foundation libraries for building a cross-platform GUI with non-C++ languages

2019-04-13 Thread treeform
I am still intrigued by your library. I find it strange that you hint that GLFW/SDL is not suitable for applications because they are not “event driven.” But almost nothing is “single frame” any more. When you hover over a button or there is a popup you want at least a couple frame of animation

Re: Tests don't want to fail - code from Nim in Action Ch3

2019-04-13 Thread SebastianM
It looks like I've missed some text.Indeed, there was to compile and run, and instead I only compiled and waited for AssertionError. The book is good, I just need to read it closely. Thank you Stefan for your explanation.

Re: Tests don't want to fail - code from Nim in Action Ch3

2019-04-13 Thread Stefan_Salewski
Yes, that is a runtime test. How did you get the impression that it is a compile time test? (Maybe the explanation was not clear enough, we may have to fix it then.)

Tests don't want to fail - code from Nim in Action Ch3

2019-04-13 Thread SebastianM
Hi there, I'm learning nim from dom's book Nim in Action and I'm stuck on testing. Here is the code: import json type Message* = object username*: string message*: string proc parseMessage*(data: string): Message = let dataJson = parseJ

Re: Con/IO terminal library for dummies

2019-04-13 Thread SolitudeSF
Nice. > Enforced prefix (con.) API isolation. yikes

Re: Con/IO terminal library for dummies

2019-04-13 Thread zolern
Really nice console, like it

Re: jester: Can't access javascript or css files

2019-04-13 Thread dom96
It's a regression on Windows, I'll fix it soon.

Re: jester: Can't access javascript or css files

2019-04-13 Thread ThomasTJdev
You have to remove the dot in the path. ./css/style.css => /css/style.css

Re: Con/IO terminal library for dummies

2019-04-13 Thread Ward
I like this very much. I desire similar module as a part of winim/conio or something, but not yet started to write.

jester: Can't access javascript or css files

2019-04-13 Thread nnahito
I want to use jester and create web sites. However it can't read files javascript and css. In jester, public folder is default static folder. [https://github.com/dom96/jester](https://github.com/dom96/jester) So, I create nim and tmpl files: ./ - [public] - [css

Con/IO terminal library for dummies

2019-04-13 Thread Aiesha_Nazarothi
After rather long and rather unpleasant fight with standard console lib, I finally decided to generalize my experience of fixing it into stand-alone library: [https://github.com/Guevara-chan/ConIO](https://github.com/Guevara-chan/ConIO) _(Windows only so far)_ **What was done as for v0.1 ?** ~