octave-maintainers
[Top][All Lists]
Advanced

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

Re: Default arguments


From: Søren Hauberg
Subject: Re: Default arguments
Date: Mon, 18 Dec 2006 20:56:09 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061115)

Søren Hauberg skrev:
Although I've checked this patch in to the CVS archive, I consider it
to be quite experimental.  If any nontrivial problems show up that are
related to this change, I'll simply remove it.
I can't really test this until sometime next week (I have a hard deadline on monday), but then I'll report back...
Okay, I've done a CVS checkout to play around with your changes. I haven't found any real problems, but there is one thing, that _might_ cause problems.

The following function works:

function out = myfun(a = 2, b = sin(a))
  out = a + b;
endfunction

but this doesn't:

function out = myfun(a = sin(b), b = 2)
  out = a + b;
endfunction

Now, I can understand why this is the case, but I'm affraid that it could cause confusion, i.e. "why doesn't my function work anymore? I've just switched the order of the input arguments."

Otherwise, it appears to be working quite nicely,
Søren


reply via email to

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