octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Idea: Extension of function / return syntax.


From: Jordi Gutiérrez Hermoso
Subject: Re: Idea: Extension of function / return syntax.
Date: Sun, 6 Jan 2013 12:25:20 -0500

On 5 January 2013 13:36, Daniel Carrera <address@hidden> wrote:
> I know that Octave is happy to extend MATLAB's syntax if that makes it
> a better language. I would like to suggest an extension of the
> "return" keyword so you can write functions like this:
>
> function momentum( mass, speed )
>
>     return  mass * speed
>
> endfunction
>
>
> In other words, instead of specifying the function outputs on the
> first line, as it is normally done in MATLAB, the return function
> could receive the set of values to be returned. This would make Octave
> consistent with many other languages like Python and Perl.

This could make sense... I'm cautiously in favour of such syntax.
Syntax additions are very delicate, however, so we need to be very
careful to make sure this doesn't break more things than what it
fixes.

- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]