I'm still on chapter 1. It's pretty big. I was trying to write all examples he
gave and in his implementation of Stack he does that. So I'll follow your
advice and just use seq.
Thanks all of you!
> In Java I just create an array with a certain size and when it's full I
> create another one with double the size and copy the elements to it.
Of course you can do exactly the same with Nim: You can create a seq of some
initial size, fill in elements, create a larger one and copy elements
The book is Algorithms from Sedgewick.
In Java I just create an array with a certain size and when it's full I create
another one with double the size and copy the elements to it. I'm doing it
wrong? I'm just following the book.
In Nim I couldn't do it. I looked at the source code on github
I was looking around for Nim koans to get a little bit of practice. I found
this repo:
[https://github.com/yashaka/nim_koans](https://github.com/yashaka/nim_koans)
Unfortunately, it seems a bit outdated as the last commits are from 2 years
ago. I also noticed that it seems somewhat incomplete.
> I got a Data Structures book
Which book do you have? Do you like it?
> I know how to do it with Java
Can you show us your code? I would like to learn how to do it in Java.
Basically, what you need to build something like Nim's seq is allocating chunks
of memory from the OS. You may inspect
You could always take a look at the Nim source code and see how Nim implements
the `seq` data type.
Hi, I'm trying to teach myself programming. I already know Javascript and a
little bit of Java. I got a Data Structures book and I decided to follow it and
do the exercises with Nim. One of the first exercises is about implementing a
dynamic vector, I know how to do it with Java but I couldn't
**Araq:** Oh yes, makes sense I worked around it exactly as you have
suggested. It would probably make sense if I post this to Nim's issues as well.
Hello awesome people,
I'm a newbie to Nim, and trying to rewrite my game engine to it to learn. I've
encountered a strange problem with template and untyped argument. I'm not sure
what exactly is going on. It feels like compiler error really, as the two
examples bellow are only different on
**@ivanitto**: I agree with Varriount that it's best to declare the types in
Nim along with the correct C type pragmas. You don't have to define the entire
type, just enough to indicate its semantics to Nim and to identify it in the C
type system:
type
BoxOfStuff {.final,
10 matches
Mail list logo