Skip to content

V0.0.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@jokade jokade released this 01 Feb 03:42
· 148 commits to master since this release
013f206

Release Notes

  • allow Out[] params for object methods

  • provide returnsSelf annotation to avoid wrapper creation if the returned reference is the same object:

    @CObj
    class Foo {
      @CObj.returnsSelf
      def foo(): Foo = extern
    }
    
    val f1 = new Foo
    val f2 = f1.foo()

    f1.foo() returns f1, not a new Foo, i.e. f1 and f2 are the same object.

  • Mutable and updatesSelf annotations allow to update the C reference hold by a wrapper object.
    Useful for data structures, where an update operation possibly returns a new C reference:

    @CObj.Mutable
    class GList(var __ref: CObj.Ref[Byte]) {
      @CObj.updatesThis
      def append(elem: Ptr[Byte]): GList = extern
    }
  • add nullable annotation to suppress wrapping if the external function returns null:

    @CObj
    class Foo {
      @CObj.nullable
      def foo(): Foo = extern
    }

    If the external call for Foo.foo() returns null, the result of Foo.foo() is also null,
    instead of new Foo(null).