V0.0.3
Pre-release
Pre-release
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()
returnsf1
, not a newFoo
, i.e.f1
andf2
are the same object. -
Mutable
andupdatesSelf
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 ofFoo.foo()
is also null,
instead ofnew Foo(null)
.