help-octave
[Top][All Lists]
Advanced

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

Assignment operators and continuation tokens (was: Re: new octave)


From: John W. Eaton
Subject: Assignment operators and continuation tokens (was: Re: new octave)
Date: Fri, 3 Mar 2006 10:10:41 -0500

On  3-Mar-2006, Miquel Cabanas wrote:

| The only? exception is when pressing the return key immediately after
| the "=" sign in an assignment, then, either you type the 3-dots or you
| get a syntax error, i.e.
| 
| octave:2> myfilter = ...
| > [
| > 100, 200, 300
| > ]
| myfilter =
| 
|   100  200  300
| 
| octave:3> myfilter =
| parse error:
| 
|   syntax error
| 
| >>> myfilter =
|               ^
| 
| I assume there must be a good reason to keep this exception.

I'm not sure that there is a good reason.  Should we consider making
it possible?  What about other binary operators?  Note that it won't
be possible to write

  some_variable
    = some_other_expression + another_expression + and_another;

without a continuation, because "some_variable" is a valid expression
by itself.

Note that it is possible to write

  octave:1> (a =
  > 1
  > + 2)
  a = 3

but that seems a bit unnatural to me.  The intended use of "automatic
continuation" inside parentheses was for function call parameters, so
it would be possible to write

  some_long_function_name (with_a_long_paramter_name, and_another,
                           and_maybe_a_few_more, without_having_to_use,
                           special_continuation_markers);


jwe



-------------------------------------------------------------
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]