Oh look, another language (ceylon)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Nov 18 09:56:32 EST 2013


On Wed, 13 Nov 2013 14:33:27 -0500, Neal Becker wrote:

> http://ceylon-lang.org/documentation/1.0/introduction/


I must say there are a few questionable design choices, in my opinion, 
but I am absolutely in love with the following two features:


1) variables are constant by default;

2) the fat arrow operator.


By default, "variables" can only be assigned to once, and then not re-
bound:

String bye = "Adios";        //a value
bye = "Adeu";  //compile error

variable Integer count = 0;  //a variable
count = 1;     //allowed


(I'm not sure how tedious typing "variable" will get, or whether it will 
encourage a more functional-programming approach. But I think that's a 
very exciting idea and kudos to the Ceylon developers for running with 
it!)


Values can be recalculated every time they are used, sort of like mini-
functions, or thunks:

String name { return firstName + " " + lastName; } 

Since this is so common in Ceylon, they have syntactic sugar for it, the 
fat arrow:

String name => firstName + " " + lastName;


If Python steals this notation, we could finally bring an end to the 
arguments about early binding and late binding of default arguments:


def my_function(a=[early, binding, happens, once],
                b=>[late, binding, happens, every, time]
                ):
    ...


Want!

These two features alone may force me to give Ceylon a try.




-- 
Steven



More information about the Python-list mailing list