V0.3.8 RELEASE NOTES

Braden Steffaniak - Mar 12, 2017

DOWNLOAD BETA v0.3.8

NOTABLE CHANGES

tl;dr:

Added full support for first-class functions [Issue #371, #374, #375, #376] permalink

More info on first class functions discussed in this post.

Added 'this' modifier for constructor parameterspermalink

Used to assign passed parameter value to field in parent class with same name as parameter. Example:

class MyClass {
  visible Int myField

  public construct(this Int myField) {}
}

let myClass = MyClass(10)

Console.writeLine(myClass.myField) // outputs 10

This code is essentially the same as this:

class MyClass {
  visible Int myField

  public construct(Int myField) {
    this.myField = myField
  }
}

let myClass = MyClass(10)

Console.writeLine(myClass.myField) // outputs 10

But reduces code duplication.

Updated declarations to default to final [Issue #368] permalink

The default state of variable declarations is now final. Final variables are good practice when writing software, and the easier it is to make final variables the better.

Previous
Int x = 10

x = 50 // valid
Current
Int x = 10

x = 50 // Compiler error, cannot modify final variable x

To declare a mutable variable you do this:

var Int x = 10

x = 50 // valid

Or, if you the type can be inferred from its assignment, you do not have to speficy the type:

var x = 10

x = 50 // valid

Added unit testing functionality with Flat Test permalink

There will be a post on how to use Flat Test's unit testing framework here.

General bug fixes [Issue #372]permalink

Fixed private function prototypes not being generated in C [Issue #372].

POSTS DOCUMENTATION