This looks like a nice library.
Few nitpickings, if you don't mind.
Exception? validateEndengered(AnimalSpecies species){
if(species.isEndangered){
return Exception("Animal is endangered");
}
return null;
}
You have properties like species.isEndangered — in Ceylon we don't generally prefix our boolean attributes with "is". That attribute should read like species.endangered instead.
Under the covers, it does translate to call to Java object's species.isEndangered() method and all shared attributes of a class defined in Ceylon have the appropriate Java Bean style accessor methods generated in JVM backend.
Secondly, perhaps the name `Exception` for a validation failure class is somewhat misleading. People generally expect Exceptions to be thrown, not returned ...
Other than that, it seems good.
neljapäev, 14. september 2017 17:23.55 UTC+3 kirjutas Voitech: