|
From: | Júlio Hoffimann |
Subject: | Re: Idea: Extension of function / return syntax. |
Date: | Sun, 6 Jan 2013 23:24:56 -0300 |
A slight variation of the proposal is that the last statement of the
function could be returned as the return value. This idea is inspired
by Perl. For example, a function could be written as:
function conserved_quantities(m,v)
energy = 0.5 * m * v * v;
momentum = m*v:
[ energy , momentum ]
endfunction
The point is that now there is no need to make changes to the "return"
statement. This idea seems to work well in the Perl world, and it is
at least clean and simple.
What do you think?
Cheers,
Daniel.
[Prev in Thread] | Current Thread | [Next in Thread] |