public DynValue ChangeDirectory(Interpreter interpreter, ClrFunctionArguments args) { args.ExpectExactly(1) .ExpectTypeAtIndex(0, DynValueType.String); var path = args[0].String; try { Directory.ChangeWorkingDirectory(path); return(DynValue.Zero); } catch { return(new DynValue(-1)); } }