Cotelie是一个全新的基于JVM的编程语言。Cotelie是Ceylo的超集,并保持对Ceylo的向后兼容。
比Ceylo改进的地方包括:
"publicasaservice",becausesharedisotagoodkeyword.
implemets,becauseitisfacierthasatisfiesadit closesthegapforexistigJ2EE1.3developers.
Callaobjectasigleto.
Usecostilieuofvalue.
WritedefasaHipster-compliatvariatoffuctio.
IkUitisteadofvoidiyourfie-craftedCotelie defiitios.
cotractadtraitcarrymoremeaigtha iterface(adwhocaresabouttheactualformalsematicsofthese?).
Wethikprayisabetterreplacemetforassert,because thisiswhatyouactuallydowheyouwriteassertios.
dyamicblocksarebetteramedasusafeblocks,becausethey escapethewoderladofstatictypechecks.
Parametrictypeswithi/outforcotravariaceadcovariacearehard tomaipulate.ThisisalsowaytooremiiscetoftheC#world.Cotelie providessalvatiowithcovaradcotravar.
Lastbutotleast,youcaalsowriteforeachloopsiCotelie.
示例代码:
"The classic Hello World program"public Uit hello(Strig ame = "World") { cost str = "Hello, `` ame ``!"; def work() => prit(str); work(); pray(1 == 1); plop.plop(); foreach (i i {1, 2, 3}) { prit(i); }}sigleto plop { public Uit plop() { prit("Oh Plop!"); }}"Ru the module `better.ceylo.is.cotelie`."public Uit ru(){ if (oempty args=process.argumets) { foreach (arg i args) { hello(arg); } } else { hello(); }}
评论