Re: Possible to use identifier construction to call proc by name (string)?

2019-10-25 Thread Krux02
This is my solution to call functions by name: [https://github.com/krux02/opengl-sandbox/blob/master/examples/console.nim](https://github.com/krux02/opengl-sandbox/blob/master/examples/console.nim) This example in this project does not have any dependentcies of that project itself, it should

Integrate a GLSL shader in Nim

2019-07-02 Thread Krux02
I made a Video showing how to use an arbitrary GLSL shader and integrate it into a Nim/SDL/OpenGL application. [Here it is](https://www.youtube.com/watch?v=mcMr142BxtI)

Re: Caller line numbers in templates?

2019-02-08 Thread Krux02
This should be an automatic solution for this problem: [https://github.com/nim-lang/Nim/pull/10569](https://github.com/nim-lang/Nim/pull/10569)

Re: Unicode display

2018-05-23 Thread Krux02
strings in Nim don't have any special Unicode support. Unicode is just designed in a way that it is compatible with ASCII. When a utf8 string contains a non-ASCII character, it will create it as a multibyte character. But all individual bytes of this multibyte character will have a value above 1

Re: How to get the address of string

2018-05-15 Thread Krux02
I don't know how `castPointer0` is used. But my experience tells me it should never have been used in the first place. You can only take the address of the first element of a string when the string is not empty. Create an issue in the issue tracker. [https://github.com/cheatfate/asyncpg/issues]

Re: How to get the address of string

2018-05-15 Thread Krux02
var a = "" With `a[0]` you expect to get the null terminator. Neither in old nor in new Nim you are allowed to write to it. With `addr a[0]` you get the address of a null terminator that you are not allowed to write to. You just should not do that. Btw `addr a` is possible though. But

Re: string change from 0.18.0 on?

2018-04-26 Thread Krux02
well you have a bug in your code, `^0` actually indexes the 0 terminator of a string, and this behavior is correct. Use `^1` instead.

Re: Problems with Bounty Source

2018-04-25 Thread Krux02
You should put the problem you are describing in the title.

Re: Float should be 32 bit, 2x performance just by changing the defaults

2018-04-25 Thread Krux02
This discussion is pointless and triggers too much attention. `sizeof(float)` won't change. if you want 32 bit float use float32.

Re: Perfecting Nim

2018-04-25 Thread Krux02
I haven't been on the forum for quite a while, just the chat and I would also like to put my wishlist of things to remove here. * the range type. Well just use `type range[low,high: static[int]] = distinct int` No need for this to be a language feature * arrays with a size that is not an int

Re: How to rewrite this in Nim style?

2018-04-02 Thread Krux02
you should be able to just remove the ref in Token = ref object. That is one layer of indirection less, and therefore faster and less memory consumption. And a little comment on what you are doing. Tokens are not nested. What you are doing is already parsing. In brainfuck all tokens are characte

Re: How to clean up native resources properly.

2017-12-08 Thread Krux02
There is also: > * there is also manual cleanup proc with defer > let vao = createVao() defer: vao.delete > * don't clean up at all. Resources are freed at program exit anyway. > There is no best way. There are only advantages and disadvantages. Choose wisely depe

Re: How do you keep your motivation on your open-source projects

2017-11-02 Thread Krux02
Techniques for dealing with lack of motivation, malaise, depression

Re: request for feedback - type safe OpenGL wrapper

2017-10-23 Thread Krux02
Well, you are not the only one who wants this. I also have my opengl wrapper as part of my program here: [https://github.com/krux02/opengl-sandbox/blob/master/fancyglpkg/glwrapper.nim](https://github.com/krux02/opengl-sandbox/blob/master/fancyglpkg/glwrapper.nim)

Re: Compile time table keys checking?

2017-10-17 Thread Krux02
Well when the holes are not too big, then an array is still suitable. Be aware you can create compile time variables and constants. compile time variables are only existent at compilation time, but can be modified, and constants are readable at compilation time as well as at runtime.

Re: Pragma for temporarily making strict identifier names?

2017-10-17 Thread Krux02
Nope, what you are looking for does not exist. All you can do is rename the Nim version of that Identifier. Be aware there are already two sdl2 wrappers around. I don't think that yet another will help anybody except yourself in learning how to write wrappers. [https://github.com/Vladar4/sdl2_n

Re:

2017-10-16 Thread Krux02
Vulkan introduced the _Standard Portable Immediate Representation_ (SPIR-V). You can imagine this as some sort of assembler instructions that will be compiled and optimized to the final GPU instructions from the GPU vendor driver. SPIR-V is through extensions and the latest core version also ava

Re: How to write (mostly)

2017-10-14 Thread Krux02
I remember reading from the factorio blog, that they had desync problems, because the math library in C++ can behave slightly different on different compilers for C++. Nim inherits this problem. I am sorry I can't quote it though.

Re: TIL more about imports

2017-09-12 Thread Krux02
I am interested in what conflicts you have, so that you really want to use the `from foo import nil` pattern. I had conflicts, too. But I never thought about using that pattern. Because even if there is a name conflict, it does not break the import I just have to be more specific for that name c

Re: Convert tuple into a Object

2017-09-01 Thread Krux02
@jacmoe, no it's not. It is [code smell](https://en.wikipedia.org/wiki/Code_smell)

Re: Convert tuple into a Object

2017-09-01 Thread Krux02
My intuition tells me that you did something wrong in your types, if you want to convert an object to a tuple or vice versa. Try to redesign your code so that you either only use tuples or only use objects, but don't try to make mixing them up easy. If you still want to make it easy to mix up t

Re: Defining an array inside a tuple

2017-08-29 Thread Krux02
@rayman22201 I did the mistake you did, too in the beginning. tuple and object are both value types like a C struct, and there is no hidden vtable in an `object` unless you inherit from `RootObj`. I think the documentation is misleading here.

Re: GetType() for object type macro parameter

2017-08-29 Thread Krux02
Pull requests that include an example in the doc comment are generally welcome.

Re: Defining an array inside a tuple

2017-08-28 Thread Krux02
I think you should use `object`, it is the equivalent of `struct` from C. type Vec2i = object x,y: int Vec2f = object x,y: float NVGglyphPosition = int32 GlyphArray* = array[100, NVGglyphPosition] TextBuffer* = object posit

Re: Simple Python-like class macro and some python-like procedures (print, input, range, others)

2017-08-28 Thread Krux02
@dom96 I am fairly sure that I submitted a pull request (that got accepted) not that long age that fixed the doc comments.

Re: Move semantic and manuel memory management

2017-08-24 Thread Krux02
There is one thing where I would like to add my two cents: Copy and move semantic which are a delight to use when writing performance critical code specially. I think Nim is poor in that regards as it deeps copies seq (vectors) and string by default It is true that Nim does no

Re: Newbie question on generic instantiation

2017-08-24 Thread Krux02
ther is a languare that supports what Ikalman does, it is scala. Here an excerpt from the repl. scala> val a = Left(123) a: scala.util.Left[Int,Nothing] = Left(123) scala> val b = Right("hallo") b: scala.util.Right[Nothing,String] = Right(hallo) scala>

Re: Newbie question on generic instantiation

2017-08-23 Thread Krux02
blah blah blah: type EitherSide = enum ok, err type Either[L, R] = object case kind: EitherSide of ok: mleft: L else: mright: R proc `right=`*[L,R](this: var Either[L, R]; value: R): void = this.kind = err this.mrig

Re: Nim in Action is now officially in print!

2017-08-18 Thread Krux02
I got my book today. Yay 💃

Re: SIMD question

2017-08-17 Thread Krux02
well, I would create simd aware types that have operators overloaded. And then I would cast to these type to use simd. # let's assume `vec' is the type with simd enabled var myArray1 = [1,2,3,4,5,6,7,8] var myArray2 = [1,1,1,1,1,1,1,1] let view1 = cast[ptr

Re: Practice code.

2017-08-14 Thread Krux02
Write a game

Re: Nim in Action is now officially in print!

2017-08-14 Thread Krux02
Well as I found out, my Book is on the way, too. Yay. Well you did not get my feedback during the development of the Book, but I think you will get my feedback when I read it. Then you can use it for revision 1

Re: Nim newbie request/challenge

2017-08-08 Thread Krux02
Can you put the paper on a link that is not behind a paywall? I am normally pretty trained to port from different languages to different languages, but from the paper I can't do copy paste at all.

Re: UDP socket closing after send

2017-08-03 Thread Krux02
About the `#? braces` feature. I didn't know about it, but I actually do like it. I just prefer `{}` over indentation based blocks. But yea I think I can live with them going away. It's not essential.

Re: Gdb pretty printers for nim

2017-08-03 Thread Krux02
I totally agree with you, debugging is really a weak spot in Nim. Things I just don't understand: By default Nim does build in debug mode, but it does not provide debugging symbols (`-g` flag for the C compiler), so that you can't actually debug with gdb your debug build. When I complain that t

Option type optimizations

2017-07-31 Thread Krux02
I implemented two optimizations for the `Option` type. The idea was to do the same as the Rust compiler, use the nil/nullptr for the none option without occupying extra memory. Then I had a similar idea for `Option[Natural]`, where I could use `-1` internally to store none. That type could be us

Re: Gdb pretty printers for nim

2017-07-31 Thread Krux02
well, I once did an approach to this, feel free to use it. This macro embeds the gdb python script into the executable, when it is build on Linux. Alternatively you can also load the script from gdb, but once this works there is no hassle involved anymore. [https://github.com/krux02/opengl

Re: What is missing for the seq/string types to be not nil by default?

2017-07-29 Thread Krux02
Thank you, and yes it is related. When I touch code of strings, everything becomes important.

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread Krux02
Ok the problem is somewhere in the garbage collecter. It tries to create an object and fails. My motivation to fix issues with the GC is pretty low. I would spend my time rather on removing the dependency on the GC than to fix the problem with it.

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread Krux02
well I did something in that direction on a branch. I have a problem with the nim compiler to crash here and there. How do I enable debug information again in the compiler? And why is is such a hassle in nim to get debug information? Debug builds should have them.

Re: String sort and handling sequence

2017-07-28 Thread Krux02
you can do this: import algorithm # algorithm contains the sort function var x = "bad cab" # `var` is for mutable x.sort(cmp)# default comparison function `cmp` from system echo x # prints " aabbcd"

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread Krux02
well are you open for a pull request for that. I think that's easy to implement.

Re: KDevelop nim/nimble project

2017-07-28 Thread Krux02
Well I don't know much about UDP. But in all tcp connections I had so far I first needed to open a server that listened on a port and then I could connect to it. You only had a dial that is confusing to be. Good to hear that you are still around btw

Re: UDP socket closing after send

2017-07-28 Thread Krux02
well according to the documentation you have to create a server first with `newSocket`, and then you can connect to that socket.

What is missing for the seq/string types to be not nil by default?

2017-07-27 Thread Krux02
The title is the question. I would like to contribute, if I can (maybe).

Re: KDevelop nim/nimble project

2017-07-27 Thread Krux02
Have you thought about creating an issue on the github page? I doubt that the developer still checks these forums.

Re: Nanovg and GLFW updates and Mac support

2017-07-27 Thread Krux02
Contribution is always welcome. You are welcome, too. Thanks.

Re: Nim to C transpiler

2017-07-27 Thread Krux02
Well nim is based on being able to compile to C. But the C code is not for readability. Even though it is quite readable.

Re: OOP Macro section of Nim by Example doesn't seem to work

2017-07-25 Thread Krux02
Truth to be told, Nim is not yet Nim 1.0 and there is no 100% guarantee that code that you write will always work in the future. But I use a lot of metaprogramming and breaking changes are very rare. But normally when things change, the language wants you to improve your code and changes are ver

Re: SDL2 and tuples as arguments

2017-07-24 Thread Krux02
well the SDL2 library is just a wrapper, and it is supposed to expose the API it wraps and nothing more. It could have convenience functions but so could you provide it.

Re: Having a hard time getting raylib bindings to work

2017-07-20 Thread Krux02
you can also add all c files of raylib manually with the compile pragma, like I did it in AntTweakBar [https://github.com/krux02/nimAntTweakBar/blob/master/AntTweakBar.nim#L43](https://github.com/krux02/nimAntTweakBar/blob/master/AntTweakBar.nim#L43)

Re: String slice performance!

2017-07-20 Thread Krux02
well you can create your own StringSlice type that does not copy and override the slicing: type StringSlice src: ptr string a,b: int proc `$`(arg: StringSlice): string = (arg.src[])[arg.a .. arg.b]

Re: Thoughts on imports

2017-07-20 Thread Krux02
well importing in a local block/function has nothing to do with runtime importing. Just see scala import. [https://en.wikibooks.org/wiki/Scala/Import](https://en.wikibooks.org/wiki/Scala/Import) and yes for your case use a when clause. The content of a when brach is at top level it does not cre

Re: How to debug nim code?

2017-07-19 Thread Krux02
well I always put my breakpoints on functions. So like this (gdb) b foobar (gdb) b foobar_123456789987654321 it is a bit more robust on the terminal than lines. And don't underestimate `(gdb) tui enable`. I wasted a lot of time with GDB. I think it's a horrible interface,

Re: How to enforce usage from module scope / top level only?

2017-07-19 Thread Krux02
Well, I would document it properly. Nim is so flexible I would not know about anything you can emit that works only top level. Maybe you can emit a function declaration that is C calling convention. Not sure if it works though.

Re: nim-random not that random at all?

2017-07-19 Thread Krux02
The random module is not very good at all, sorry for that. But there is a mersenne twister in the standard library. This is what I use. Upper bound is exclusive. proc rand*(maxval: uint32): uint32 = let limit = uint32(high(uint32)) - uint32(high(uint32)) mod maxval var

Re: Nim image libraries

2017-07-18 Thread Krux02
well sdl2 is not part of the standlard lib, it is just on the nim-lang github account. And `IMG_SavePNG` from SDL2_image is not documented. It works and can be used but it is non-official. Well when it is about, what could be ported, I would add this, but it is currently without a nim version:

Re: In-Memory Database

2017-07-14 Thread Krux02
Well there are [tables](https://nim-lang.org/docs/tables.html#initTable,int) all in memory, just not very persistent

Re: How do fellow new comers deal with optional parenthesis dropping?

2017-07-14 Thread Krux02
hmm, I am a bit surprised, I would have guessed the following parsing rule: echo b, c d, e f g, h echo(b, c(d, e(f(g, h # <--- I expected this echo(b, c(d), e(f(g)), h) # but hey it's this

Re: [noob] enums and index

2017-07-12 Thread Krux02
I did not know this is possible. Seems very interesting.

Re: Nim vs D

2017-07-07 Thread Krux02
I think the difference is in the details, but the details matter. I would really be interested to get some experience from people who actually had projects in both languages. Because then you get to know about differences that actually matter. A tiny feature of the Nim language, the dot call sy

Re: Normalized AST presentation of the proc body

2017-07-05 Thread Krux02
well, not that I know of. You should know that a dot expression can be a function call, but it can also be an access to an object member. I think you have to write your own normalization function.

Re:

2017-06-26 Thread Krux02
Yes converters are probably your way to go. Probably means that there is still the option, because there is still case that creating a new type is not the way to go, and you should just have sticked with using a `table`.

Re: video about my opengl sandbox project

2017-06-23 Thread Krux02
Thanks for the positive feedback. This motivates to do more in the future. Don't hesitate to ask questions about things you did not understand. When you ask I knew that you are actually interested in the content.

video about my opengl sandbox project

2017-06-20 Thread Krux02
[https://www.youtube.com/watch?v=JO0iqGDgFqA](https://www.youtube.com/watch?v=JO0iqGDgFqA) Keep in mind this is my first video that I made to demonstrate something. For me it felt totally weird to talk to a computer without response. So the slow speaking is nothing I need feedback about, I think

Re: package like python's pandas?

2017-06-20 Thread Krux02
Well to write wrappers, the most useful tool you have around is c2nim. That helps you with initial translations. Of course you need to also undersdand how C works or writting correct wrippers might become a bit tricky. But definitively check out other wrapper code that was already been written i

Re: echo proper string in different consoles?

2017-06-20 Thread Krux02
Don't use Windows. Seems to be bad software No seriously. I have no idea. I can only guess what to look for. Does msys2 try to make `getCurrentEncoding` behave correctly? Does msys2 try to make everything more unix like and make the shell utf8? Does msys2 have any information about encoding?

Re: Progress Bar using stdout.write and eraseLine()

2017-06-20 Thread Krux02
Instead of `eraseLine` you can also always print `"\r"`. That character does not erase the line, but puts the write cursor back at the beginning of the line. output after that overrides what is already there. So in this case, where you always print the full length of the progress bar, the effect

Re: Linear algebra library

2017-06-07 Thread Krux02
Value types have a good advantage, but the problem is, that when you make them too big, they could overflow the stack (iirc 2MB on Windows). But you should use value type arguments, because a ref type can always be converted to a value type with the `[]` operator. proc foo1(arg: Ma

Re: package like python's pandas?

2017-06-07 Thread Krux02
Well if you need docx, then find some tools that do your needs in docx. Maybe you find the right command line tools that will convert the important parts of your docx files into something that you can process. Then you can continue in Nim. Maybe you can find a C library that supports extracting

Re: Do notation without parentheses

2017-06-07 Thread Krux02
There was a breaking change in the do notation that I don't approve personally at all. But I thought it was parsing rules only.

Re: Binary unicode operators

2017-05-23 Thread Krux02
Well I would like to have `¬∨∧` as aliases for `not`, `or`, `and`. But it doesn't seem that I well get it `¯\_(ツ)_/¯`

string result from macro

2017-05-19 Thread Krux02
Normally I would think that when I return a value from a macro or set the result to that value. There would be no difference. But aparently there is: import macros macro testA: string = result = newLit("testA") macro testB: untyped = newLit("testB")

Re: Surprising floating point equality

2017-05-15 Thread Krux02
This is just a bug and should be reported let y: float32 = 47.11'f32 assert y == 47.11'f32 # < this really should be true.

Re: pointer to array?

2017-05-11 Thread Krux02
Honestly I don't know. I try to avoid `ref` as much as I try to avoid `std::shared_ptr` in C++ because for me they are semantically the same. But I know that the programming language Go does not have distinct types for `ref` and `ptr`. In that language a pointer simply keeps a block of memory du

Re: pointer to array?

2017-05-10 Thread Krux02
@jxy yes there is a difference betwen `ref A` and `ptr A`. When the ref is implemented as an `std::shared_ptr` (I think Araq mentioned an option once to do that), then `ref A` takes over the ownership and as soon as the reference is deleted, also the memory will be deleted. You don't want that,

Re: when will [] ambiguous be solved?

2017-05-05 Thread Krux02
Wait a moment, are you shure this D code is equivalent to the Nim code you just posted? struct Bar { void bar() { "bar".writeln; } } To me this looks like just a _method_ (in c++ terms). And a _method_ is not a value member of a struct. In other words it does not increase the

Re: float64 hash

2017-05-03 Thread Krux02
If I remember correctly, the hash function for doubles in Nim is converted over from LUA. In lua double are often used as integers because for the most part lua did not have integers like javascript. Therefore the hash function was chosen to optimize this use case.

Re: Nim Chess 2 with transposition table support is available

2017-05-02 Thread Krux02
I did not try Vulkan yet, but I read a lot about it. More control and so on. And a unified API for both mobile and desktop. Even more things that you can do wrong and get a black screen without feedback is not really somethign I am looking forward to. My library is trying to get exactly this par

Re: Fastest way to pack CSV file

2017-05-02 Thread Krux02
> No, the original problem was about removing entries from a CSV file, > something which grep cannot do particularly well...  challenge accepted: grep -f delete -v data.csv > filtered.csv rm data.csv mv filtered.csv data.csv `delete` is the file with the names to dele

Re: Nim Chess 2 with transposition table support is available

2017-05-02 Thread Krux02
You could write a nice 3D renderer for the game state, with this library: [https://github.com/krux02/opengl-sandbox](https://github.com/krux02/opengl-sandbox) But be aware I did not define a fixed mesh format nor an _.obj_ loader because of it. So the initial renderer would use cones and

Re: Blog post about Nim performance tuning

2017-04-29 Thread Krux02
since it is basically me who took over the nim_glm maintenance. The version you fixed is very old and not the version anymore that I maintain currently anymore. I should mention that I never did performance benchmarks on that library, only correctness tests. I only applied my knowledge of what i

Re: Blog post about Nim performance tuning

2017-04-29 Thread Krux02
since it is basically me who took over the nim_glm maintenance. The version you fixed is very old and not the version anymore that I maintain currently anymore. I should mention that I never did performance benchmarks on that library, only correctness tests. I only applied my knowledge of what i

Re: Tetris in Nim in 3D

2017-04-26 Thread Krux02
well I know blockout, and I do like it. I actually thought to add a game mode for blockout, too. But before that, this game needs to become a but fancier.

Re: Checking in macro if proc has side effects or not

2017-04-23 Thread Krux02
i can also imagine that the cause of compiles to fail is, that you have a double definition of the same function when you try to compile the exact same function again. So I think it would be sufficient to replace the symbolf the function with a new identifier.

Re: Checking in macro if proc has side effects or not

2017-04-21 Thread Krux02
well, when it doesn't work it is probably a Nim bug. Create an issue.

Re: Checking in macro if proc has side effects or not

2017-04-21 Thread Krux02
Well I don't know if there is something built into the language to do that simply. But you can jump to the definition of the proc symbol and get the implementation. You could add the noSideffects pragma to the function and then test if that ast still compiles with `system.compiles`.

Tetris in Nim in 3D

2017-04-21 Thread Krux02
yay tetris > here is the sourcecode: [https://github.com/krux02/opengl-sandbox/blob/master/examples/tetris.nim](https://github.com/krux02/opengl-sandbox/blob/master/examples/tetris.nim)

Re: Need a push on investigation of compiler issue

2017-04-20 Thread Krux02
I just wanted to comment, that tuples have already a `[]` operator. They accept a static int `n` as argument and return the _n-th_ element of that tuple. It is not overloadable, but I guess all you have to do is to make it overloadable by handling the magic in `magicsAfterOverloadResolution`.

Re: New website released!

2017-04-20 Thread Krux02
Well I realized the single most important information (at least for me when I came to Nim) is missing on the front page of the new website: metaprogramming.

Re: New website released!

2017-04-19 Thread Krux02
@Araq Well I did in fact know very little about the possibilities to use Nim without garbage collection. All I heared about was the `string` and `seq` are implemeneted in a way that they need the gc to run. Because I did not find any other documantation I came to the conclusion that disabling th

Re: How do I debug the Nim compiler?

2017-04-19 Thread Krux02
I found out how to do it: nim c --lineDir:off --debuginfo compiler/nim

Re: New website released!

2017-04-19 Thread Krux02
Well, when you say that GC is optional, you should say that disabling it pretty much makes the types seq and string unusable, and therefore the GC is not really optional.

How do I debug the Nim compiler?

2017-04-19 Thread Krux02
I have a problem I have absolutely no clue why this happens: [https://github.com/nim-lang/Nim/pull/5664](https://github.com/nim-lang/Nim/pull/5664) In order to find out why this happens I would like to debug the compiler. Since I think that the problem is somewhere in the generated C code I woul

Re: New website released!

2017-04-19 Thread Krux02
I like the new website. It shows that this language is living and evolving. There is only one thing I would like. The menu bar for Documentation should open like a menu bar on windows and show the links without an intermediate website. This speeds up navigation. +--+--

Re: book delayed again

2017-04-19 Thread Krux02
@Fungi well you do not have the best diplomatic strength. When you write in a Forum for Nim developers that what they are doing is entirely wrong and sucks a lot, then you will earn a lot of hate. You are right, performance is not everything. But Nim is not entirely about performance, it is abou

Re: book delayed again

2017-04-18 Thread Krux02
@Fungi, it's nice that you found out that Nim is not the language for you, but you should understand that everybody's point of view is always a very limited view on the world. Nobody knows everything. What I want to say is, just because you don't see the advantages of compiled programming langua

Re: Can var proc parameters be faster than function results?

2017-04-18 Thread Krux02
I think for a fair comparison, you should zero out the memory in the `var`-parameter case, because that is done for the result variable and therefore would be the only fair comparison. But I think even then it would not explain the big difference.

Re: ref object or object with ref field

2017-04-12 Thread Krux02
@LeuGim well when you have an array of RootObj, not a ref/ptr to RootObj in the array, the array actually doesn't contain the subtype anymore. So sure when you iterate and call foo on each object. It does call the method from RootObj, but only because you actually have a true RootObj value there

Re: ref object or object with ref field

2017-04-11 Thread Krux02
@dom96 I am well aware that seq is implemented as a pointer, but it has value semantics. That is the reason I did not mention it. var a = @[1,2,3] var b = a # b is now a new copy of a

  1   2   3   4   >