[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: return, continue, break -> ans = 1
From: |
Pascal A. Dupuis |
Subject: |
Re: return, continue, break -> ans = 1 |
Date: |
Wed, 4 Dec 2002 10:17:30 -0600 |
On Tue, 3 Dec 2002, John W. Eaton wrote:
> My changes were simple. They just made break, continue, and return do
> what did before, but also behave as functions that returned 1 so they
> would be valid in logical contexts. But a simple change is not good
> enough, and I don't see a way to allow the Perl-like behavior and also
> be backward compatible without making some major changes to the way
> Octave's parser and interpreter work. I don't think it is worth the
> effort and I've undone the changes I made earlier. The CVS archive
> should be updated within a few minutes.
>
Hello John,
In fact, the || and && construct with a second member of return, break, or
continue is a sh mechanism (roughly speaking, Perl is a glue logic system
which supersedes sh). It is available in bash. May I suggest to ask to the
peoples maintaining bash how this is accomplished there, and eventually
transpose it to octave ? Just a 2 eurocent suggestion...
Regards
Pascal Dupuis
--
Dr. ir. Pascal Dupuis
K. U. Leuven, ESAT/ELECTA (formerly ELEN): http://www.esat.kuleuven.ac.be/
Kasteelpark Arenberg, 10; B-3001 Leuven-Heverlee, Belgium
Tel. +32-16-32 10 12 -- Fax +32-16-32 19 85