sergiotaborda / lense-lang

The Lense Language Compiler
1 stars 0 forks source link

Allow for Native Peers #24

Closed sergiotaborda closed 3 years ago

sergiotaborda commented 8 years ago

Native peers a native implementations (possibly several static methods on a native class) that implement some of the methods in the lense class. This differs from native types where the whole type is native. With native peers the bulk of the code is written in lense and some methods are delegated to native code

class Buffer {

    constructor Buffer (length : Natural, encoding : Encoding); 

    public write (String text){ // defined in lense
           write(encoding .asByteSequence(text));
    }
    public native write (Sequence<Byte> bytes);  //defined in the native peer

}