io.carbon 739 B

1234567891011121314151617181920
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. // TODO: This library is not part of the design. Either write a matching
  5. // proposal or remove this.
  6. package Core library "io";
  7. import library "prelude";
  8. // TODO: Support printing other types.
  9. // TODO: Consider rewriting using native support once library support exists.
  10. fn Print(x: i32) = "print.int";
  11. fn PrintChar(x: char) -> i32 = "print.char";
  12. // TODO: Return an `Optional(char)` instead of `i32`.
  13. fn ReadChar() -> i32 = "read.char";
  14. // TODO: Change this to a global constant once they are fully supported.
  15. fn EOF() -> i32 { return -1; }