On Sunday, 11 October 2015 at 01:52:12 UTC, deadalnix wrote:
On Saturday, 10 October 2015 at 16:31:27 UTC, Ola Fosheim
On Saturday, 10 October 2015 at 12:51:43 UTC, Jacob Carlborg
In Ruby, no one will ever use empty parentheses for calling a
That's actually the same as Simula. Functions/procedures with
no parameters is called without parentheses.
That's actually quite beautiful in its simplicity.
It is ok, but I find it more confusing than the C syntax when
using a plain text editor. With distinguishing syntax colouring
it might work out better, it is one of those cases where an IDE
could make a difference.
Nygaard et al later improved on the uniformity of Simula in the
language BETA by recognizing that a parameter list is the same as
a tuple, with this syntax:
input_tuple -> object_or_function -> output_tuple;
(1,(2,3)) -> something1 -> something2 -> (a,b)
(1,(2,3)) -> &run_concurrent_object
Without any input tuple, one can naturally omit the input arrow.
That also means that BETA does not distinguish between a function
call and an assignment. An instanced object is just a function
that persist state over calls, aka variable or a
process/coroutine. A class type acts like a function when it
called without being already instanced. So I think it provides
better orthogonality than in C++/D where you can have both opCall
The downside by having the consise BETA syntax and OO semantics
is that you need to change how you conceptualize OO modelling.
BETA has been generalized further in the academic language gbeta,
which also have some dependent typing. Which is kind of
interesting in relation to D, because it appears to be heavily
built upon mixins: