Native code builtins
18 builtins of Soma 3.2.4 in the category Native code, with their exact signatures, as soma describe --builtins --json prints them.
- buffer
- buf_get
- buf_set
- buffer_f
- buf_get_f
- buf_set_f
- hashmap
- hm_get
- hm_set
- hm_inc
- hm_len
- hm_has
- strbuf
- sb_push
- sb_push_int
- sb_push_char
- sb_len
- sb_finish
buffer
buffer(n: Int) -> Buf [native] onlyArray of n Ints, zeroed. Random access with buf_get / buf_set. Not available in interpreted handlers.
buf_get
buf_get(b: Buf, i: Int) -> Int [native] onlyRead b[i].
buf_set
buf_set(b: Buf, i: Int, v: Int) -> () [native] onlyWrite b[i] = v.
buffer_f
buffer_f(n: Int) -> BufF [native] onlyArray of n Floats, zeroed (buf_get_f / buf_set_f).
buf_get_f
buf_get_f(b: BufF, i: Int) -> Float [native] onlyRead b[i].
buf_set_f
buf_set_f(b: BufF, i: Int, v: Float) -> () [native] onlyWrite b[i] = v.
hashmap
hashmap() -> HMap [native] onlyInt → Int hash map (hm_get / hm_set / hm_inc / hm_len / hm_has).
hm_get
hm_get(m: HMap, k: Int) -> Int [native] onlyValue at k, 0 when absent.
hm_set
hm_set(m: HMap, k: Int, v: Int) -> () [native] onlym[k] = v.
hm_inc
hm_inc(m: HMap, k: Int) -> () [native] onlym[k] += 1 (inserting 1).
hm_len
hm_len(m: HMap) -> Int [native] onlyNumber of keys.
hm_has
hm_has(m: HMap, k: Int) -> Bool [native] onlyWhether k is present.
strbuf
strbuf(capacity?: Int) -> SBuf [native] onlyGrowable string builder (sb_push / sb_push_int / sb_push_char / sb_len / sb_finish).
sb_push
sb_push(b: SBuf, s: String) -> () [native] onlyAppend a string.
sb_push_int
sb_push_int(b: SBuf, n: Int) -> () [native] onlyAppend an Int's decimal digits.
sb_push_char
sb_push_char(b: SBuf, c: Int) -> () [native] onlyAppend one character by code point.
sb_len
sb_len(b: SBuf) -> Int [native] onlyBytes so far.
sb_finish
sb_finish(b: SBuf) -> String [native] onlyThe built String.