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. <[email protected] <javascript:>> > 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 of code.... >> false >> end >> >> Note that I wanna jump only one level above, not like break or return >> keywords. >> > > 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 could be quite handy... > > >> P.S. Why loops don't return the last line executed value like all other >> blocks do? >> > > What value should they evaluate to if they execute zero times? > `nothing`
