Re: [julia-users] one lvl return kw

2016-06-10 Thread Stefan Karpinski
On Fri, Jun 10, 2016 at 3:52 PM, Ford O. wrote: > > >> Aside from goto, is there any language that has this? >>> >> > None that I know of, but that doesn't mean it's a bad feature on it's own. > Since every kind of block can return a value in julia, stronger control > over the returned value cou

Re: [julia-users] one lvl return kw

2016-06-10 Thread Ford O.
On Friday, June 10, 2016 at 9:41:20 PM UTC+2, Stefan Karpinski wrote: > > On Fri, Jun 10, 2016 at 3:26 PM, Ford O. > > wrote: > >> Why is there no keyword that would allow programmer to do >> >> var = begin # any block, including : let, if, function, macro, for, >> while >> in = user_inpu

Re: [julia-users] one lvl return kw

2016-06-10 Thread Stefan Karpinski
On Fri, Jun 10, 2016 at 3:26 PM, Ford O. wrote: > Why is there no keyword that would allow programmer to do > > var = begin # any block, including : let, if, function, macro, for, while > > in = user_input() > if in == something >`kw` true # immediately jumps out of this block > #lots

Re: [julia-users] one lvl return kw

2016-06-10 Thread Mauro
You're probably looking for @goto ;-) Although break may be what you want: julia> for i=1:10 for j=1:10 if j==3 break end end println(i,j) end 13 23 33 43 53 63 73 83 93 103 On Fri, 2016-06-10 at 21:26, Ford O. wrote: > Why is there no keyword t

[julia-users] one lvl return kw

2016-06-10 Thread Ford O.
Why is there no keyword that would allow programmer to do var = begin # any block, including : let, if, function, macro, for, while in = user_input() if in == something `kw` true # immediately jumps out of this block #lots of code false end Note that I wanna jump only one level