There's a unicode integer division operator. \div then hit tab, you get ÷. Many editors have plugins for similar latex-tab-completion to make unicode math symbols easier to write.
Nearly anything can be implemented as a library in Julia. See https://github.com/alsam/OffsetArrays.jl, https://github.com/eschnett/FlexibleArrays.jl, and several others. There's a currently very active discussion on github about how to make Julia's standard library accommodate custom array types as best as it can. See http://julialang.org/blog/2016/03/arrays-iteration as well. On Saturday, April 2, 2016 at 4:55:55 AM UTC-7, Spiritus Pap wrote: > > Hi there, > > TL;DR: A lot of people that could use julia (researchers currently using > python) won't. I give an example of how it makes my life hard, and I try to > suggest solutions. > > Iv'e been introduced to julia about a month ago. > I'm an algorithmic researcher, I write mostly research code: statistics, > image processing, algorithms, etc. > I use mostly python with numpy for my stuff, and C/++ when I need > performance. > I was really happy when I heard of julia, because it takes the simplicity > of python and combines it with JIT compilation for speed! > > I REALLY tried to use julia, I really did. I tried to convince my friends > at work to use it too. > However, there are a few things that make it unusable the way it is. > > Decisions that in my opinion were made by people who do not write > research-code: > 1. Indexing in Julia. being 1 based and inclusive, instead of 0 based and > not including the end (like in c/python/lots of other stuff) > 2. No simple integer-division operator. > > A simple example why it makes my *life hard*: Assume there is an array of > size 100, and i want to take the i_th portion of it out of n. This is a > common scenario for research-code, at least for me and my friends. > In python: > a[i*100/n:(i+1)*100/n] > In julia: > a[1+div(i*100,n):div((i+1)*100,n)] > > A lot more cumbersome in julia, and it is annoying and unattractive. This > is just a simple example. > > *Possible solutions:* > The reason I'm writing this post is because I want to use julia, and I > want to to become great. > *About the division:* I would suggest *adding *an integer division > *operator*, such as *//*. Would help a lot. Yes, I think it should be by > default, so that newcomers would need the least amount of effort to use > julia comfortably. > > *About the indexing:* I realize that this is a decision made a long time > ago, and everything is built this way. Yes, it is like matlab, and no, it > is not a good thing. > I am a mathematician, and I almost always index my sequences expressions > in 0, it usually just makes more sense. > The problem is both in array (e.g. a[0]) and in slice (e.g. 0:10). > An array could be solved perhaps by a *custom *0 based *array object*. > But the slice? Maybe adding a 0 based *slice operator*(such as .. or _)? > is it possible to do so in a library? > > I'd be happy to write these myself, but I believe these need to be in the > standard library. Again, so that newcomers would need the least amount of > effort to use julia comfortably. > If you have better suggestions, I'd be happy to hear. > > Thank you for your time >
