@Araq Thank you. Of course it was my mistake. I used wrong account and that
list was just empty.
@juancarlospaco Thanks. Why I did not get that idea myself... ;)
First of all. Congratulations.
> But you're spot on, I hope this feature means we can remove method from the
> language.
If you do, you may consider put some words into documentation what to do to
achieve similar behaviour because there is quite a lot of people that are
comfortable with that a
Jonathan Blow is creating this language and compiler and actually as testing he
is making a game in it. There you can declare things as SOA or AOS (struct of
arrays or array of structs). I encourage you to visit his videos sessions on
youtube. So it exists but is not available yet.
Thank you for your explanation. Whereas I can understand I am not good at
applying this knowledge in practise. First lets take a look at object variant
polymorphism. It can do the same as methods but then cases sneak everywhere
which is ugly. Then, let me elaborate more. There are entities. Enti
Thank you. From my examples also I realized that I am tending to mix reference
semantics with value semantics which lead to quite frustrating bugs.
I have found such example when seq is immutable
type B* = object
myseq: seq[int]
type A* = object
bseq*: seq[B]
proc test1() =
var b: B
b.myseq = newSeq[int]()
var i = 0
while i < len(b.myseq):
if
Yes. First I am afraid they could remove them, second and more important, it
means they do such things in different way which I would like to learn.
Thank you. Would you mind to present "colsure" solution? The one you suggested
would not be feasible as every entity can have various nubmer of various
components.
Hi
I need a hint.
Provided I have such construction
type Component = ref object of RootObj
type Entity = ref object
components = seq[Component]
method update(c: Component) = discard
Then, I have components, like:
type Fighter = ref object
Hi
I have had hard time with method which did not behave as I expected to.
child.nim
type Parent* = ref object of RootObj
type Child* = ref object of Parent
type Some = object
method getDataToSave*(x: Parent): object {.base.} =
echo("took getDataToSave Pare
I do not know the rules. But if anyone would like to write it in Nim I would be
happy to join. Recently I was working on something that resemble Roguelike:
[Not Roguelike!](https://dl.dropboxusercontent.com/u/21455945/NotRoguelike.GIF)
Sublime works decent with nimlime. However it was recently abandoned so I am a
bit worried.
Great idea. Rather short videos focused on particular subject. Worth mentioning
is basics, how to install, how to use, hello world, then syntax, datatypes,
object model, ref and without ref. More advanced topics could cover generics,
templates, marros. Now please bear in mind that I am not parti
Just remark. In SQL Server for instance you can design query graphically but
everyone (in my experience) just write it in text. I am trying to say that it
would not be easy to go to higher level of abstraction. Graphical languages are
not very popular. Human is a beast which thinks rather sequen
I think that also the question is whether we (you rather) are making practical
language or academic one. I am not sure if both can be successfully combined
(although such approach worked for pypy they say). Endow language with all
shiny, "it is how it should be" etc. concepts, which can by the w
While I agree with everything what Libman says I am also a bit afraid.
* syntax wars will not be ceased in peaceful Nim world, they will be drag
inside Nim world
* Nim already allows using quite different styles. And it happens quite often
that I am looking at someone's code and it take me t
>From system.nim
iterator `..`[S, T](a: S; b: T): T {..}
An alias for countup. Source Edit
Anyway, could not it work with a > b? Probably there is some reasoning behind
this and I am trying to understand.
Hi
I have been wondering why _`..`_ operator works only for _countup_. Why there
is no counterpart for _couontdown_?
For instance something like:
when sizeof(int) <= 2:
type IntLikeForCount = int|int8|int16|char|bool|uint8|enum
else:
type IntLikeForCount = int|
Hi
I would like to ask you for help again.
I am trying to achive double buffering for console under Windows (I was in
shock when I noticed that there is double buffering for console).
My current code:
import winim
from os import execShellCmd, sleep
var buffer1: HANDL
Thank you. Will take a look. I am looking for simple solutions. Patty is for
sure marvellous but 400 lines (or so) of code to emit few lines of code is
intimidating to me.
So final version from my first post would now look like:
(I took variantp from andrea's patty and added my version of match)
template match*(t: typed, handlers: openArray): untyped =
var x = ord(t.kind)
handlers[x](t)
message.nim
import patty
Thank you **andrea**.
I like your _variant_ but _match_ is for me similar in verbosity to my getText
and I think it could be compressed further.
My attempt:
import patty
variant Message:
hit(hp: int)
death(died: string)
proc hhit(m: Message) = echo
Hi
I needed some sort of polymorphism, but did not want to use inheritance and
methods because it needs heap allocation and I have quite small objects which
are created and destroyed frequently.
Finally I came out with setup which I was comfortable with, and here is example:
message.nim
Thank you **god**. data[][0].addr was what I was looking for, tried to use repr
to check but it turned out unreliable and so my confusion. So **Araq** was
right, I was trying to send pointer, but I could not find from his answer where
I made it wrong.
I know. Closed. I am sorry but let me add last quick remark. Such discussions,
even when look somewhat as a fight, are not necessarily bad thing. It is good
to see some other people opinions as long as they are backed up with
constructive arguments. So if it is possible to make section for my qu
My understanding is that I **do not** send pointer but I give address of start
of memory from which pipe should send the data of bytes length. And the pipe is
to cross the processes barrier. Also I have no idea how or what could I use
from stdlib.
So I modified god's example. The main differrence is that server receives data
and client pushes and data should be string. Unfortunatelly after many many
hours i gave up and would like to ask you for help again. I feel I am doing
something terrible with strings and its places in memory.
server
Thank you Krux and Araq. repr is very useful to be able to understand what is
going on in my program. I am trying to send strings through a pipe (without
success) so casting to pointer and knowing what is exactly happening is crucial
for me.
Hi
I am having hard time understanding pointers, addr, cstrings.
var i: cstring = "a"
var pi: ptr cstring = i.addr
echo repr(i)
echo repr(pi)
Output:
005BC058"a"
ref 004477F8 --> 005BC070"a"
My understanding is this. First we declare variabl
Thank you for your reply **Krux02**, I appreciate it. Not quite there however
because what I am interested in is processes not threads and how to set up
communication between two. Also I am looking for pipes, shared memory, ffs and
differences among them, performance etc. I do not want to setup
Could you paste your solution (the IPC part) for future reference?
Thank you. I will use this IRC bridge. Anyhow, I feel forum is a lot better for
even newbie questions. If language becomes more popular you will have the same
questions asked again and again in IRC whilst they should be easy discoverable
in forum (like in stackoverflow), this could serve as addi
When I am in forum view I see there are 4 answers in this thread and I see also
AironGregatti. However when I enter I see only 3 posts without that from Airon.
Why is this so? Moderation?
Hi
"Btw please join IRC or gitter instead of flooding this forum with newbie
questions, no offense."
I do not want to flood your forum, but I do realize my questions would be
newbie as well. The problem is, if I use irc-like I have chance to get answer
only from people who are already online/r
Andrea, whilst its true, it is on library creator side, whilst we may want to
decide how it would look like in our code, when there are two libraries where
their creators did not use distinct type.
Hi
I am trying to open new console window and be able to write to it. My attempts
failed. How to do that? (currently using MinGW)
During my attempts I tried to create process using startProcess I noticed that
I can get then FileHandle for process. However I do not know how obtain File to
which
36 matches
Mail list logo