Expand description
I/O Operations for Seq
These functions are exported with C ABI for LLVM codegen to call.
§Safety Contract
IMPORTANT: These functions are designed to be called ONLY by compiler-generated code, not by end users or arbitrary C code. The compiler is responsible for:
- Ensuring stack has correct types (verified by type checker)
- Passing valid, null-terminated C strings to
push_string - Never calling these functions directly from user code
§String Handling
String literals from the compiler must be valid UTF-8 C strings (null-terminated).
Currently, each string literal is allocated as an owned String. See
docs/STRING_INTERNING_DESIGN.md for discussion of future optimizations
(interning, static references, etc.).
Re-exports§
pub use patch_seq_exit_op as exit_op;pub use patch_seq_int_to_string as int_to_string;pub use patch_seq_push_interned_symbol as push_interned_symbol;pub use patch_seq_push_seqstring as push_seqstring;pub use patch_seq_push_string as push_string;pub use patch_seq_push_symbol as push_symbol;pub use patch_seq_read_line as read_line;pub use patch_seq_read_line_plus as read_line_plus;pub use patch_seq_read_n as read_n;pub use patch_seq_string_to_symbol as string_to_symbol;pub use patch_seq_symbol_to_string as symbol_to_string;pub use patch_seq_write as write;pub use patch_seq_write_line as write_line;
Structs§
- Interned
Symbol Data - Layout of static interned symbol data from LLVM IR
Functions§
- patch_
seq_ ⚠exit_ op - Exit the program with a status code
- patch_
seq_ ⚠int_ to_ string - Convert an integer to a string
- patch_
seq_ ⚠push_ interned_ symbol - Push an interned symbol onto the stack (Issue #166)
- patch_
seq_ ⚠push_ seqstring - Push a SeqString value onto the stack
- patch_
seq_ ⚠push_ string - Push a C string literal onto the stack (for compiler-generated code)
- patch_
seq_ ⚠push_ symbol - Push a C string literal onto the stack as a Symbol (for compiler-generated code)
- patch_
seq_ ⚠read_ line - Read a line from stdin
- patch_
seq_ ⚠read_ line_ plus - Read a line from stdin with explicit EOF detection
- patch_
seq_ ⚠read_ n - Read exactly N bytes from stdin
- patch_
seq_ ⚠string_ to_ symbol - Convert a String to a Symbol
- patch_
seq_ ⚠symbol_ to_ string - Convert a Symbol to a String
- patch_
seq_ ⚠write - Write a string to stdout without a trailing newline
- patch_
seq_ ⚠write_ line - Write a string to stdout followed by a newline