help-octave
[Top][All Lists]
Advanced

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

Re: named arguments


From: fork
Subject: Re: named arguments
Date: Fri, 16 Mar 2012 18:51:16 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

John W. Eaton <jwe <at> octave.org> writes:

> You can already do keyword-value pairs, so I don't see the point of
> introducing new syntax in the function declaration.

Not to pander to the unwashed or anything, but experience R and Python
programmers LOVE the keyword syntax, and I think it would have great appeal.  It
is much easier to remember parameter names than parameter positions, since they
have actual meaning.

While parseparams and stuff work fine, they add lines of code (and lines of code
always have a cost in initial coding time and ease of maintenance), and they are
a bit tricky.  And definitely ugly compared to X=Y.  Python's keyword syntax is
dead simple to understand.

Also, I think it is important to keep matlab -> octave compatibility, but octave
-> matlab not so much.  (I don't consider it vendor lock-in when the system is
Free.)  With broadcasting we emit a warning, we have "endfunction" and friends,
etc.

Also, it is one thing to hit ML compatibility with current syntax, but with
trying to second guess syntax that *might change* is silly, unless there is a
document or something telling us to expect the change.

This would be a big change and we should worry over it pretty hard and keep it
optional, but I think it would be a GREAT addition to the language if we could
do it right.

My fairly worthless $0.02...





reply via email to

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