A small comment in favor of optional line continuations. I've sometimes
used code to write out complicated symbolic equations, sometimes thousands
of lines long. I found it easy to programmatically spit out both C and
Matlab code, only having to do a semi-colon (and a ... for Matlab). I agree
parens can mostly take care of anything, but it might be nice to have an
optional continuator, which can be clear, simple, and explicit. A parser
might not need it, but a human might still find it easier.
If there were an optional continuator, I would suggest against "..." which
should be reserved for splatting, so x... means only one thing. I have
complained about how the Julia documentation is confusing because sometimes
... means splat, sometimes it means "and so on", with no clear indicator
which is intended. In most cases context is sufficient to figure out the
meaning, but better to be explicit and use a separate symbol to mean a
separate thing.
On Thursday, June 18, 2015 at 8:59:49 AM UTC-4, Christoph Ortner wrote:
>
> As I said, it is "OK". I am getting used to it.
> Christoph
>
> On Thursday, 18 June 2015 13:34:14 UTC+1, Patrick O'Leary wrote:
>>
>> "Busier" I agree with, but it's marginal; grouping is lightweight as
>> syntax goes. Parens (1) already work, (2) consistently mean "keep these
>> things together" in a variety of computing environments, (3) have match
>> highlighting support in many editors which make it easy, given one end of
>> the parenthesized subexpression, to find the other end. So I'm not sure I
>> agree with the latter, especially if indentation is used effectively.
>>
>> On Thursday, June 18, 2015 at 6:53:54 AM UTC-5, Christoph Ortner wrote:
>>>
>>>
>>> I think parenthesis are "ok", but only just. They make the code busier
>>> and more difficult to read.
>>> Christoph
>>>
>>>
>>> On Tuesday, 16 June 2015 01:21:45 UTC+1, David Gold wrote:
>>>>
>>>> @Ben: as has been noted elsewhere in this thread, you can use parens to
>>>> this end:
>>>>
>>>> julia> function foo(a, b, c, d, e, f)
>>>> if (a > b
>>>> || c > d
>>>> || e > f)
>>>> println("Foo for you.")
>>>> end
>>>> end
>>>> foo (generic function with 1 method)
>>>>
>>>> julia> foo(1, 2, 3, 4, 6, 5)
>>>> Foo for you.
>>>>
>>>>
>>>> Is there a reason this is significantly worse than what you described?
>>>>
>>>> On Monday, June 15, 2015 at 5:54:56 PM UTC-4, Ben Arthur wrote:
>>>>>
>>>>> in addition to adhering to mathematical typsetting conventions,
>>>>> permitting binary operators to be on the following line would make it
>>>>> easier to comment out sub-expressions. for example,
>>>>>
>>>>> if a>b
>>>>> || c>d
>>>>> || e>f
>>>>> end
>>>>>
>>>>> could become
>>>>>
>>>>> if a>b
>>>>> # || c>d
>>>>> || e>f
>>>>> end
>>>>>
>>>>> i'm not advocating for a mandatory line continuation character. that
>>>>> would be terrible. but changing julia to look at the preceding line if
>>>>> the
>>>>> current line doesn't make sense by itself would be great.
>>>>>
>>>>> ben
>>>>>
>>>>>
>>>>>
>>>>> On Monday, June 1, 2015 at 3:35:50 PM UTC-4, Christoph Ortner wrote:
>>>>>>
>>>>>>
>>>>>> Just to reiterate a comment I made above: the convention in
>>>>>> mathematical typesetting is
>>>>>> b
>>>>>> + c
>>>>>> and not
>>>>>> b +
>>>>>> c
>>>>>>
>>>>>> this is the main reason I have (more than once) fallen into this
>>>>>> trap. Anyhow, I will try to use brackets for a while and see how I like
>>>>>> it.
>>>>>>
>>>>>> Christoph
>>>>>>
>>>>>