FYI: Ceylon
Paul D. Anderson
paul.d.removethis.anderson at comcast.andthis.net
Fri Jul 13 16:31:02 PDT 2012
I took a quick look at the Ceylon language
(http://ceylon-lang.org/) which is supposed to be a follow on to
Java (they disavow the name "Java Killer" <wink, wink, nudge,
nudge>).
One of their design goals is "familiar, readable syntax", but
they seemed to have missed the boat on that one. Their type
system is Byzantine and it is the heart of the language.
But I thought this little fragment from their spec dealing with
type constraints was interesting:
(The words "given", "satisfies", "abstracts", "of" and "is" are
keywords.)
<quote>
There are five different kinds of type constraint:
• an upper bound, given X satisfies T, specifies that the type
parameter X is a subtype of a given type T,
• a lower bound, given X abstracts T, specifies that a given
type T is a subtype of the type parameter X,
• an enumerated bound, given X of T|U|V specifies that the type
parameter X represents one of the enumerated types,
• a parameter bound, given X(...) specifies that the type
parameter X is a concrete class with the given parameter types,
and
• a metatype bound, given X is T, specifies that the concrete
metatype of the type parameter is a subtype of a given type T.
</quote>
They also have couple of operators, '===' and '<=>' meaning
'identical' and 'compare', respectively. They have an identity
operator but also have the keyword 'is', which should give you an
inkling of the languages complexity. I assume 'compare' is the
same as D's 'opCmp', and it strikes me as a useful operator.
(Although I think the unusual comparison operators in D ('!<>=')
wound up high on the list of the "too many features" post.
Paul
More information about the Digitalmars-d
mailing list