help-octave
[Top][All Lists]
Advanced

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

Philosophy help.


From: Douglas Eck
Subject: Philosophy help.
Date: Wed, 06 Dec 2000 11:59:43 +0100

Why doesn't Octave stay matlab compatible
when it seems easy to be matlab compatible? 
Isn't it a design goal of octave to be matlab compatible?

For example matlab's default is to short-circuit 
the or operator (|). Why does octave have a new
short-circuit operator (||) and make (|) not short-circuit.
Isn't it clear that changes like this make it
absolutely hell to have code that is both matlab and
octave clean? 

I'm not trying to be nasty or negative. I'm just confused.
I've got roughly 10,000 lines of matlab code to port. I'm happy,
very very happy, to port it to octave and am excited to get away
from Mathworks!  But I need somehow to get a grip on these
differences early so that I don't go insane. And clearly
I still want to be able to run my code under matlab.

I guess the real question is: is it possible to write clean
matlab-octave code? And is it a design goal of the octave
group to make this possible? It *seems* possible, but when
you come to examples like the or operator, it starts to 
feel a bit daunting to really have a big project work in both. 

Ah well, I could always use make (laugh, its funny...)

function [bar] = myfun(foo)
#ifdef OCTAVE
if nargin<1 | isempty(foo)
#endif
#ifdef MATLAB
if nargin<1 || isempty(foo)
#endif

Cheers,
Doug



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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