<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 October 2015 at 14:51, Jacob Carlborg via Digitalmars-d-announce <span dir="ltr"><<a href="mailto:digitalmars-d-announce@puremagic.com" target="_blank">digitalmars-d-announce@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2015-10-10 03:52, Martin Nowak wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Scala and Ruby seem to do well with sloppy parens.<br>
</blockquote>
<br></span>
A few notes about why Ruby doesn't have the same problems as D has:<br>
<br>
1. Ruby has optional parentheses for all method calls, regardless if they accept arguments or not<br>
<br>
2. Ruby has a different syntax for calling lambdas from calling functions:<br>
<br>
def foo<br>
end<br>
<br>
foo() # calling function<br>
<br>
a = -> { }<br>
a.call # calling lambda<br>
a.() # alternative syntax for calling lambda<br>
<br>
In Ruby, no one will ever use empty parentheses for calling a method.<br>
<br>
3. You can not use the setter syntax for a "regular" method taking one argument:<br>
<br>
class Foo<br>
  def bar(a)<br>
  end<br>
<br>
  def foo=(a) # not the same name as "foo"<br>
  end<br>
end<br>
<br>
a = Foo.new<br>
a.bar = 3 # error<br>
a.foo = 3 # ok<br>
a.foo(3) # error<span class="HOEnZb"><font color="#888888"><br>
<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">It seems to be a misfeature of D to accept the equivalent of all three of those examples as valid.<br></div><div class="gmail_extra"><br></div></div>