octave-maintainers
[Top][All Lists]
Advanced

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

Re: continuation line markers


From: Rik
Subject: Re: continuation line markers
Date: Wed, 03 Apr 2013 15:12:39 -0700

On 04/03/2013 10:00 AM, address@hidden wrote:
> Message: 3
> Date: Wed, 03 Apr 2013 11:28:34 -0400
> From: "John W. Eaton" <address@hidden>
> To: Jordi Guti?rrez Hermoso <address@hidden>
> Cc: octave maintainers mailing list <address@hidden>
> Subject: Re: Continuation lines
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 04/03/2013 11:04 AM, Jordi Guti?rrez Hermoso wrote:
>
>> > Yes, I was thinking of this case:
>> >
>> >     [1, 2\
>> >      3, 4]
>> >
>> > You can't really replace that backslash with anything but the
>> > ellipses.
> OK.  I guess I'm wondering whether it is really a big advantage to
> have two different types of continuation markers.
Maybe not a big advantage, but I'd like to keep the '\' form if it isn't
too much work.
>
>> > Why, because of the left division ambiguity? If that's the reason, I
>> > still don't think this ambiguity has ever caused problems. If the
>> > reason is so that \ behaves exactly like ..., then I can agree, but
>> > I'm happy with the slight discrepancy here, as long as you don't see
>> > other problems with it.
> No, I don't think there is a problem other than the duplication and
> that's not a huge problem.
>
> I'm proposing to eliminate comments after \ just to simplify the
> lexer.  There don't seem to be any uses of this feature in the .m
> files in Octave.  There are some in Octave Forge .m files, but I only
> see one file where the continuation markers actually needed (the
> others are inside parens).
I'd rather preserve them.  Octave is a superset of Matlab so we can have
these extra features if it pleases us.  In particular, for anyone coming
from a UNIX background the backslash is the obvious character for line
continuations.  As Jordi pointed out, lots of other languages use this as
well so it makes picking up Octave more natural.  This is in the same vein
as offering the '#' character as a comment character which seems obvious
only because so many other programs have already chosen that character for
comments.

On an even less worthy note, I find the '...' syntax to be long.  If the
expression is already butting up against 80 characters then taking out four
characters for a space and three periods is overly much.  This can happen
if you are several layers into nesting and then find that you can only get
on property/value pair on the line before the next line continuation is
required.

--Rik



reply via email to

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