No return statement is kind of an explicit indication that the function 
does not return anything. This is at least how we know it from a lot of 
other languages. Thus at least for me as a previous C++ programmer it 
seemed pretty natural.


Am Mittwoch, 25. Mai 2016 23:50:50 UTC+2 schrieb Jeff Bezanson:
>
> If we want to change this, I also like the simplicity of Stefan's 
> proposal. However, on the whole I agree with Didier and prefer keeping 
> things as they are. Automatically adding `return nothing` can be seen 
> as making `nothing` the "default return value", which implies that 
> returning nothing is a good thing. I also don't feel it answers the 
> "explicit is better than implicit" objection that started this thread, 
> since the value being returned would not be evident in the code. 
>
> On Wed, May 25, 2016 at 3:09 PM, 'Tobias Knopp' via julia-users 
> <julia...@googlegroups.com <javascript:>> wrote: 
> > I like Stefans idea. Would be great to open an issue for that on github. 
> > 
> > Tobi 
> > 
> > 
> > Am Mittwoch, 25. Mai 2016 15:23:22 UTC+2 schrieb Michael Borregaard: 
> >> 
> >> To me, the suggested change seems to conflict intuitively with julia 
> >> syntax. When using Julia at the REPL all expressions return a value, 
> which 
> >> is confusing at first when coming from othe languages but quickly 
> becomes a 
> >> feature. That a function also returns the value of the last statement 
> seems 
> >> consistent with this. 
> >> Also, a common use of multiple dispatch is to have methods that modify 
> >> arguments then call another method of the same name defining the basic 
> >> functionality. Eg. 
> >> 
> >> function foo(x::SomeType) 
> >> ... 
> >> end 
> >> 
> >> function foo(x::SomeOtherType) 
> >>   y = dostufftogetsometype(x) 
> >>   foo(y) 
> >> end 
> >> 
> >> where this syntax seems intuitive. 
>

Reply via email to