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.
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
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
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
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
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)
Is there a reason finalizers need to be set in `new` as opposed to following
destructors?
proc `=finalize`(x: T) = ...
Run
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)?
What glibc version is required? Should both Linux and Windows versions be built
with it?
@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
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
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.
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.)
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
Nice.
> Enforced prefix (con.) API isolation.
yikes
Really nice console, like it
It's a regression on Windows, I'll fix it soon.
You have to remove the dot in the path.
./css/style.css => /css/style.css
I like this very much. I desire similar module as a part of winim/conio or
something, but not yet started to write.
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
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 ?** ~
21 matches
Mail list logo