octave-maintainers
[Top][All Lists]
Advanced

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

Re: Default arguments


From: Tom Holroyd (NIH/NIMH) [E]
Subject: Re: Default arguments
Date: Fri, 15 Dec 2006 12:35:37 -0500
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)



John W. Eaton wrote:
On 15-Dec-2006, Tom Holroyd (NIH/NIMH) [E] wrote:

| | > It would also be better to be able to call foo like | > | > foo(arg = 42) | | That could break existing code, though, because that's valid syntax now (set the local variable arg).

Yes, it would definitely cause trouble for Octave, though we could
consider a new operator, like

  foo (arg := 42)

But in Matlab assignment is not an expression, so the syntax you
quoted does not presently work.

But it does work in Octave! (That's what's important. :-)

I think a new operator would be a good way to go.

--
Tom Holroyd, Ph.D.
We experience the world not as it is, but as we expect it to be.


reply via email to

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