Front page | perl.fwp |
Postings from July 2001
Re: Sorting in-place
Thread Previous
|
Thread Next
From:
pcg
Date:
July 31, 2001 15:09
Subject:
Re: Sorting in-place
Message ID:
20010801000916.L10116@cerebro.laendle
On Tue, Jul 31, 2001 at 11:51:48PM +0200, Abigail <abigail@foad.org> wrote:
> sub foo {
> ....
> EXPR;
> return
> }
>
> and you are done. No "uglyness". All you needed to do is adding an
well, and then my neighbour comes and removes the "return;". in perl5,
"return;" at the end of a function is redundant unless you add such action
at a distance like with sort. Yes, you _can_ program weird functions
that do one thing in one context and totally difefrent things in another
context, but most just plain avoid it because it's not intuitive. PDL for
example has an inplace() function that marks operations as inplace, if
possible. (of course it's only an optimization issue).
> explicite return so there are no implicite returns giving you an
> unexpected context.
Remember that the discussion does not go about wether it is possible (we
all know it is) but wether it makes sense or makes programs easier. You
are just writing down what everybody already knows anyway.
(ok, not everybody, which adds to the problem).
--
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE --+
The choice of a GNU generation |
|
Thread Previous
|
Thread Next