Most likely Julia tries to parse it as x > 10 ? return ((0):nothing) Try x > 10 ? (return 0) : nothing
instead. Or the more popular construction x <= 10 || return 0 Den tisdagen den 25:e november 2014 kl. 11:21:39 UTC+1 skrev andreas: > > > Dear list, > > I observed that this > > function foo(x) > x <= 10 ? nothing : return(0) > y = 2*x > return(y) > end > > works as expected, while that > > function bar(x) > x > 10 ? return(0) : nothing > y = 2*x > return(y) > end > > throws an error: "ERROR: syntax: colon expected in "?" expression". > > Is this an intended behavior? > > Cheers, > Andreas > > PS: I'm using Julia v 0.3.3 on Windows 7 >