Changelog
0.4.0
Interesting features has been added to Cor this time, the exception handling has been revamped with simplified syntax while it remains fully compatible with javascript exceptions model. The Cor syntax now supports the exist (?
) operator, which is a good replacement for the if
statement to check for existence, it makes Cor
more expressive but still sober and readable.
Let's see an example of error handling in 0.4.0
:
// throwing errors
func explode() { error('Booooom!') }
// handling error
func handleError() {
catch horror() {
console.log(error())
}
}
?
, example: customers[0]?.accounts?.length
catch/error
statementChangelog
0.3.0
This release brings important language additions in order to look modern allowing to write less code without loosing readability. Was added the coalesce operator (??
), also the &
symbol now should be used as a replacement of @
to create new objects. Now the lambda function has a convenient shorter syntax to fill some use cases, however, the new syntax does not replaces the classic one.
A show case using some features of the new syntax. Lets assume we are using Underscore.js:
Before 0.3.0
:
stooges = [
@[name: 'curly', age: 25],
@[name: 'moe', age: 21],
@[name: 'larry', age: 23],
]
func init() {
ch = _.chain(stooges)
ch.sortBy(func(s){ return s.age })
ch.map(func(s){ return s.name + ' is ' + s.age })
console.log(ch.first().value()) // "moe is 21"
}
With 0.3.0
:
stooges = [
&[name: 'curly', age: 25],
&[name: 'moe', age: 21],
&[name: 'larry', age: 23],
]
func init() {
ch = _.chain(stooges)
ch.sortBy(func(s) s.age)
ch.map(func(s) s.name + ' is ' + s.age)
console.log(ch.first().value()) // "moe is 21"
}
As you can see, the code with 0.3.0
is cleaner and still remains readable with a modern look.
??
&
operator for literal contruction@
operator for literal contruction in favor of &
{}
Changelog
0.2.6
Important changes has been factored since 0.2.1
, the most important new feature is the possibility to build your project in 4 different ways: domready
, commonjs
, amd
and global
. Hence you can deliver your lib/app with full compatibility in the js
ecosystem. The compiler now preserves comments(either doc-block
and single line comment
) and translate it to javascript comments which is very useful for the sake of source documentation and debugging.
js
sourceamd
, commonjs
and amd
package typesuse
statementChangelog
0.2.1
This release removes multiple inheritance in favor of single inheritance. Said that, from this release we promote composition over inheritance, however you can use single inheritance depending on your needs.
super
no longer can be called from a class which does not inheritssuper
is usedChangelog
0.1.4
This release fixes a malformation of bower.json
among others. The changes introduced in 0.1.0
qre now documented.
bower.json
malformationmake release
taskChangelog
0.0.2
The main motivation of this release is to provide an installable package for testing availability in NPM and Bower repositories.
Shipping :