After reading about Julia at http://learnxinyminutes.com/docs/julia/ , I came across this:
I am sure this is a great explanation, but I do not understand the main idea / advantages.
From what I understand so far:
- Using splat in a function definition allows us to indicate that we don’t know how many input arguments will be provided for the function, maybe 1, maybe 1000. I don’t really see the benefits of this, but at least I understand (hopefully) the concept of this.
- Using splat as an input argument to a function does ... What exactly? And why should I use this? If I had to enter the contents of the array into the argument list, I would use the syntax instead: some_array (:, :) (for 3D arrays, I would use some_array (:,:, :), etc.).
I think part of the reason why I don’t understand this is because I am struggling with the definition of tuples and arrays, are tuples and arrays data types (like Int64 - data type) in Julia? Or is it a data structure and a data structure? When I hear an array, I usually think of a 2D matrix, maybe not the best way to represent arrays in a programming context?
I understand that you could probably write whole books about what a data structure is, and I could say with confidence that this is Google, however I believe that people with a deep understanding of the subject can explain this much more succinctly ( and possibly simplified), then let him say that the Wikipedia article may be, so I ask you guys (and girls).
source share