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: Daniel Carrera
Subject: Re: Idea: Extension of function / return syntax.
Date: Mon, 7 Jan 2013 05:17:06 +0100

On 7 January 2013 03:24, Júlio Hoffimann <address@hidden> wrote:
> I think you missed the main point in having a return statement: return from
> anywhere in the function body.

I do know the point of the return statement. But anyway, your
criticism is valid in that my most recent suggestion would clearly
cause problems. I withdraw that second suggestion, but I still think
that my original suggestion is a good idea.


> IMHO, this is a change that doesn't add major benefits.

I think the benefits are comparable to other small things that Octave
has already added, like C-style operators, using double quotes for
strings, and so on. All the changes that I am aware of that Octave has
added are things that I would consider small, but I am glad that they
are there. These differences are the only reason I do not dismiss
Octave as just a Matlab clone.


> We want to improve the language, but we shouldn't forget nor misrepresent 
> it's origins.

Allowing the return statement to take a parameter does not deny the
origins of Octave any more than adding C-style operators like ++, or
C-style comparisons !=, or UNIX-shell-like comments #, or double
quoted strings.

> Your
> mention to Perl is very appropriate, it evolved so much that became
> incompatible with older releases. Perl 6 is a complete redesign announced in
> 2000 and still under active development as of 2012.

But Perl 6 is intended to be an entirely new language. It is wholly
unreasonable to compare the drastic rewrite of Perl, with my proposal
to extend the "return" statement. Furthermore, I have not advocated
any incompatible change. The previous syntax SHOULD continue to work.

Cheers,
Daniel.
--
Lord of the rings calendar in your Linux/Unix/Mac terminal: cat
/usr/share/calendar/calendar.lotr


reply via email to

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