Re: Compositional inheritance voodo

2017-09-05 Thread jacmoe
> It seems to be valid Nim code. That's what I wanted to know, thanks! > It's also a design right from the 90ies, slow, impossible to parallelize, > hard to serialize. I know. I wouldn't have come up with the design if I wrote it myself, because it is a straight port of the Python tutorial cod

Re: Compositional inheritance voodo

2017-09-05 Thread Jehan
> So, what I basically want to know is if what I wrote is valid and sound Nim > code. It is valid code. However: You don't actually use inheritance in your code for `Fighter` and `Thing`, so `of RootObj` and `method` (instead of `proc`) may introduce unnecessary overhead, unless you plan on us

Re: Compositional inheritance voodo

2017-09-05 Thread Araq
It seems to be valid Nim code. It's also a design right from the 90ies, slow, impossible to parallelize, hard to serialize.

Re: Compositional inheritance voodo

2017-09-04 Thread jacmoe
So, what I basically want to know is if what I wrote is valid and sound Nim code. It seems to work, though.

Re: Compositional inheritance voodo

2017-09-04 Thread jacmoe
Thanks! I searched for 'concept' but it failed me - I even looked at the section you linked to, but managed to overlook the (prominent) section on concepts ;p Yes, even though I am a programmer - and thus prone to overthinking - I guess I'd get the basics down before moving on to unchartered te

Re: Compositional inheritance voodo

2017-09-04 Thread bpr
> I guess I can't find them because they are unstable, right? They're in the [language manual](https://nim-lang.org/docs/manual.html#generics-type-classes), right after `type classes`, as they used to be known as "user defined type classes". Beware that some [parts](https://nim-lang.org/docs/m

Re: Compositional inheritance voodo

2017-09-04 Thread jacmoe
> Generally Nim's docs = [..] concise and legible. Exactly. And one of the main reasons why I have decided to prefer Nim

Re: Compositional inheritance voodo

2017-09-04 Thread LeuGim
Generally Nim's docs = Nim's manual, and generally to find an answer in it takes seconds, it's concise and legible.

Re: Compositional inheritance voodo

2017-09-04 Thread jacmoe
Any good docs on concepts in Nim ? I failed to find it in the tutorial - perhaps I should browse the manual as well ?

Re: Compositional inheritance voodo

2017-09-04 Thread Tiberium
You can also try concepts

Compositional inheritance voodo

2017-09-04 Thread jacmoe
I am very new to Nim, and am trying to port the libtcod tutorial written in Python - here: [Complete Roguelike Tutorial, using python+libtcod](http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod) \- to Nim. For the most part, it is smooth sailing, but n