3 ms·
Pet curiosity ... if the inventors would humour me. What was the thinking behind adopting the `end` notation for marking the end of blocks. I know that certain
by ahurmazda 6y ago
Pet curiosity ... if the inventors would humour me.
What was the thinking behind adopting the `end` notation for marking the end of blocks. I know that certain family of PLs (Erlang, Ruby) use them. But the dominant flavor is the `{}` syntax (c/c++/scala/rust etc)
Was it an explicit choice or more based on your past familiarity with other languages?
- newen 6y agoIt’s from Matlab. That’s really it. Well, and probably {} are perfectly good characters that shouldn’t be wasted on code blocks.
- patal 6y agoSo it's from Fortran ;)
- eigenspace 6y agoThe reason is that they want to reserve the curly braces for other uses and the language devs call using `{}` to delimit code a 'waste of valuable ascii characters'. Julia currently uses {} mostly for type systemy things like parametric types. When I write Foo{T}, this says that T is a parameter in the type Foo. E.g. a vector of Float64s in julia is an Array{Float64, 1} (1 means one dimensional) whereas a matrix of vectors of complex Ints is an Array{Array{Complex{Int}, 1}, 2}.