On Sunday, 11 October 2015 at 01:52:12 UTC, deadalnix wrote:
On Saturday, 10 October 2015 at 16:31:27 UTC, Ola Fosheim Grøstad wrote:
On Saturday, 10 October 2015 at 12:51:43 UTC, Jacob Carlborg wrote:
In Ruby, no one will ever use empty parentheses for calling a method.


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 and opAssign.

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:

http://www.daimi.au.dk/~eernst/gbeta/

              • ... Meta via Digitalmars-d-announce
              • ... Jonathan M Davis via Digitalmars-d-announce
              • ... deadalnix via Digitalmars-d-announce
              • ... Johannes Pfau via Digitalmars-d-announce
              • ... Jacob Carlborg via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Jacob Carlborg via Digitalmars-d-announce
              • ... Iain Buclaw via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... deadalnix via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Meta via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Meta via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... deadalnix via Digitalmars-d-announce
    • Re: Beta D 2.069.0-b1 anonymous via Digitalmars-d-announce
    • Re: Beta D 2.069.0-b1 ponce via Digitalmars-d-announce
  • Re: Beta D 2.069.0-b1 Suliman via Digitalmars-d-announce

Reply via email to