
header "sys" as sys

+ fn println(msg: String) {
    let data = msg.data
    let len : uint = msg.bytes
    let fd : i32 = 1
    @ptrv(data, u8, len) = '\n'
    #if OS == win
    sys:write(fd, data, (len + 1).@cast(u32))
    #else
    sys:write(fd, data, len + 1)
    #end
    @ptrv(data, u8, len) = 0
}

+ fn print(msg: String) {
    write(1, msg) ! { return }
    // let data = msg.data
    // let len : uint = msg.bytes
    // let fd : i32 = 1
    // sys:write(fd, data, len)
}

+ fn print_from_ptr(adr: ptr, len: uint) {
    write_bytes(1, adr, len) ! return
}
