[julia-users] prefix / infix syntax bridge

2016-04-05 Thread 'Till Schröder' via julia-users
Hi, as far as I know, the parentheses are just for better readability. But I'm sorry to say that you can't add bew operators as far as I know. You could do that with macros (I believe), but that would be a mess. Just stick ti the existing ones. Since I'm also a beginner I'm not entirely sure on

Re: [julia-users] prefix / infix syntax bridge

2016-04-05 Thread Isaiah Norton
> > Also another question: is it possible, as in Haskell, to define new > infix operators No. There was some discussion of supporting Haskell-like custom infix with backticks, but I don't think anyone ever tried to implement it. (and if backticks syntax is ever freed-up, there are probably

Re: [julia-users] prefix / infix syntax bridge

2016-04-05 Thread Erik Schnetter
The syntax without parentheses works only for some operators; it does not work e.g. for `&`, since `&` is also a prefix operator. There are also some contexts where parsing is ambiguous without the parentheses, e.g. expressions such as `[+ + +]`. This could be an array literal with three

[julia-users] prefix / infix syntax bridge

2016-04-05 Thread Didier Verna
Hi, the user manual says this (VARIABLES section): "Operators like + are also valid identifiers, but are parsed specially. In some contexts, operators can be used just like variables; for example (+) refers to the addition function, and (+) = f will reassign it." This looks like Haskell's