Paste: clay question

Author: blei
Mode: text
Date: Sun, 1 Aug 2010 13:47:37
Plain Text |
import unix;

alias MAXPATHLEN = 1024;

currentDirectory() {
    var buf = Array[Byte,MAXPATHLEN]();
    unix.syscallNoThrow(unix.getcwd, &buf, UInt64(MAXPATHLEN));
    return String(buf);
}



###############################

inlined syscallNoThrow(callable, ...args) {
    var result = callable(...args);
-------------------------^
    if (result == Type(result)(-1))
        errorNoThrow(errorMessage());
###############################
/home/philipp/programming/clay/build/compiler/src/../../../lib-clay/unix/unix.clay(15,25): error: argument 1: type mismatch

compilation context: 
  syscallNoThrow(CCodePointer[(Pointer[Int8], UInt64), Pointer[Int8]], Pointer[Array[UInt8, 1024]], UInt64)
  currentDirectory()
  println(Vector[Char])
  main()
  getExitCode()
  callMain(Static[main])

New Annotation

Summary:
Author:
Mode:
Body: