|
x-engine-c v0.2.13
The C engine for x-lang
|
String manipulation primitives. More...
#include "x-prim.h"#include "x-type/char.h"#include "x-type/int.h"#include "x-type/str.h"#include "x-type/symbol.h"Functions | |
| static x_obj_t * | x_prim_string_append (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_make_str (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_string_to_symbol (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_symbol_to_string (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_list_to_string (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_str_byte_len (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_str_byte_ref (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_str_byte_sub (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_prim_string_register (x_obj_t *p_base, x_obj_t *p_args) |
String manipulation primitives.
Build a string from a list of characters, one byte per character. x-lang: (bytes->str list-of-chars)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (bytes->str list-of-chars). |
Allocate a fresh writable byte region as a string object. x-lang: (make-str n)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (make-str n). |
n bytes. Raw byte length of a string. x-lang: (str-byte-len s)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (str-byte-len s). |
s. Byte at index i of a string, as a CHARACTER (0-255). x-lang: (str-byte-ref s i)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (str-byte-ref s i). |
Byte substring: len bytes of s starting at byte offset start. x-lang: (str-byte-sub s start len)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (str-byte-sub s start len). |
len bytes from byte offset start. Concatenate two strings. x-lang: (str-append a b)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (str-append a b). |
a followed by b. Register string manipulation primitives.
Binds: str-append, str->symbol, symbol->str, bytes->str, str-byte-len, str-byte-ref, str-byte-sub.
bytes->str is the raw byte-packer (one low byte per char). The code-point-aware list->str is pure x-lang (x/type/str-utf8), UTF-8 encoding each char on top of bytes->str; boot-time callers that want bytes call bytes->str directly.| p_base | Interpreter base context. |
| p_args | Unused. |
p_base. Convert a string to an interned symbol. x-lang: (str->symbol str)
| p_base | Interpreter base context. |
| p_args | Unevaluated argument list: (str->symbol str). |
str.