On Sunday, April 3, 2016 at 12:09:35 PM UTC-4, Tim Holy wrote:
>
> Indexing with // is a bit undesirable because 6//3 gets simplified to 2//1 
> upon 
> construction, and there's no reason to pay the cost of that operation. 
>

That was Eric's idea - I was strictly talking about integer division, not 
indexing.
I do have a lot of hope that a clean, flexible AND performant API will be 
made for Julia, from the discussions you in particular have been leading on 
GitHub.
I would definitely like to have 0-based, row-major arrays that are as 
performant in Julia as 1-based, column-major ones are, and that allow easy 
interfacing
between Julia and C/C++/Java in-memory structures.

With \\, would you worry about confusion from the fact that in a \\ b, a is 
> in 
> the denominator? Especially if it gets called the "integer division 
> operator." 
>

It might confuse some of the mathematicians, used to a \ b as a inverse 
multiplication operator, however, other languages use a \ b for what in 
Julia is div(a, b) or a÷b,
so I really don't think a definition of \\ as div(a, b) would be that much 
of a problem, no worse than other things you have to remember in Julia,
and it's reminiscent of the // integer division operator in Python and Lua.

One could use ///, but that's starting to be pretty comparable to 
> \div[TAB], 
> and less pretty to read. 
>

Most anything would be better than having to use a Unicode operator for 
such a common operator, having to deal with different ways of typing it in 
the REPL, your editor, etc, IMO.

-Scott

Reply via email to