From a64f0ada5fd3f97ba8afdd70cd2e7c75064447ef Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 12 Nov 2022 20:30:47 +0200 Subject: [PATCH] update src/README.md --- src/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/README.md b/src/README.md index 229c4323..4fb13e94 100644 --- a/src/README.md +++ b/src/README.md @@ -52,12 +52,14 @@ src/ * `c1`, `c2` in `h.h` - correspondingly monadically or dyadically invoke a function * `evalBC` in `vm.c` - VM bytecode interpreter -* `slash_c2` in `builtins/sfns.c` - implementation of `๐•จ/๐•ฉ` -* `GC2i` & `GC2f` invocations in `builtins/arithd.c` - dyadic pervasive builtins +* `slash_c2` in `builtins/slash.c` - implementation of `๐•จ/๐•ฉ` * See `load.c` `fruntime` items for more builtins (remove leading `bi_` & append `_c1`/`_c2` to get the implementation function) * `load_init` in `load.c` - loads the BQN runtime & compiler * `bqn_comp` in `load.c` - execute BQN code from a string * `BN(allocL)` in `opt/mm_buddyTemplate.h` - fast path of buddy memory allocator; invoked from `opt/mm_buddy.h` +* `builtins/arithd.c` - dyadic pervasive builtins + * non-Singeli `รทโˆšโ‹†|`: `GC2f`; `ร—โˆงโˆจโŒŠโŒˆ+-` array F array: `AR_I_AA`, atom F array: `AR_I_SA` + * Singeli: implementations in `src/singeli/src/dyarith.singeli`, requirements/tables generated by `src/singeli/src/genArithTables.bqn` ## Base @@ -104,7 +106,7 @@ Functions for converting/using basic types: q_fusz(x) q_usz(x) q_N(x) // query if x is ยท (โ‰ก bi_N) - noFill(x) // if x represents undefined fill (returned by getFill*; โ‰ก bi_noFill) + noFill(x) // query if x represents undefined fill (which returned by getFill*; aka test if equal to bi_noFill) tag(x,*_TAG) // pointer โ†’ B See src/h.h for more basics @@ -249,13 +251,13 @@ B r = m_c32vec_0(U"โŸจ1โ‹„2โ‹„3โŸฉ"); // ..or with implicit length B r = m_c8vec("hello", 5); // a constant ASCII string B r = m_c8vec_0("hello"); // ..or with implicit length B r = utf8Decode("โŸจ1โ‹„2โ‹„3โŸฉ", 17) // decode UTF-8 from a char* -B r = utf8Decode_0("โŸจ1โ‹„2โ‹„3โŸฉ") // ..or with implicit length +B r = utf8Decode0("โŸจ1โ‹„2โ‹„3โŸฉ") // ..or with implicit length #include "utils/utf.h" u64 sz = utf8lenB(x); TALLOC(char, buf, sz+1); toUTF8(x, buf); buf[sz]=0; /*use buf as a C-string*/ TFREE(buf); // src/utils/mut.h provides a way to build an array by copying parts of other arrays -// some functions for specific cases: +// some functions for making specific arrays: B r = m_unit(x); // equivalent to <๐•ฉ B r = m_hunit(x); // like the above, except no fill is set B r = m_atomUnit(x); // if x is likely to be an atom, this is a better alternative to m_unit @@ -267,7 +269,6 @@ B r = emptyHVec(); // an empty vector with no fill B r = emptyIVec(); // an empty integer vector B r = emptyCVec(); // an empty character vector B r = emptySVec(); // an empty string vector -// rank can be manually set for an exsiting object with sprnk or srnk, but be careful to keep the shape object in sync! ```