add thing that was previously non-existent

This commit is contained in:
dzaima 2022-08-26 10:16:16 +03:00
parent 1927cb5756
commit b16378bef6
3 changed files with 18 additions and 3 deletions

View File

@ -59,7 +59,7 @@ Get the hash of `𝕩`.
Monadically, use the global secret value which will differ between CBQN sessions.
Dyadically, use the integer left argument as the secret. Will be the same between multiple CBQN sessions, but may change between versions.
Dyadically, use the integer left argument as the seed. Will be the same between multiple CBQN sessions, but may change between CBQN versions.
## `•PrimInd`
@ -75,7 +75,13 @@ Compare arguments. Equal to `((⊑⍋-⍒)⋈)`.
Convert the argument UTF-8 byte array (or character array consisting of codepoints 0-255) to a string.
May be removed in the future.
May be removed or renamed in the future.
## `•ToUTF8`
Convert the argument character list to a UTF-8-encoded byte array, represented as a list of characters with codepoints 0-255.
May be removed or renamed in the future.
## `•CurrentError`

View File

@ -9,7 +9,7 @@
/* sort.c*/A(gradeUp,"") A(gradeDown,"") \
/* everything before the definition of •Type is defined to be pure, and everything after is not */ \
/* sysfn.c*/M(type,"•Type") M(decp,"•Decompose") M(primInd,"•PrimInd") M(glyph,"•Glyph") A(fill,"•FillFn") M(sys,"•getsys") A(grLen,"•GroupLen") D(grOrd,"•GroupOrd") \
/* sysfn.c*/M(repr,"•Repr") M(fmt,"•Fmt") A(asrt,"!") A(casrt,"!") M(out,"•Out") M(show,"•Show") A(bqn,"•BQN") A(sh,"•SH") M(fromUtf8,"•FromUTF8") M(currentError,"•CurrentError") \
/* sysfn.c*/M(repr,"•Repr") M(fmt,"•Fmt") A(asrt,"!") A(casrt,"!") M(out,"•Out") M(show,"•Show") A(bqn,"•BQN") A(sh,"•SH") M(fromUtf8,"•FromUTF8") M(toUtf8,"•ToUTF8") M(currentError,"•CurrentError") \
/* sysfn.c*/D(cmp,"•Cmp") A(hash,"•Hash") M(unixTime,"•UnixTime") M(monoTime,"•MonoTime") M(delay,"•Delay") M(makeRand,"•MakeRand") M(reBQN,"•ReBQN") M(exit,"•Exit") M(getLine,"•GetLine") \
/* sysfn.c*/M(fName,"•file.Name") M(fParent,"•file.Parent") \
/* sysfn.c*/M(tRawMode,"•term.RawMode") M(tFlush,"•term.Flush") M(tCharB,"•term.CharB") M(tCharN,"•term.CharN") M(tOutRaw,"•term.OutRaw") M(tErrRaw,"•term.ErrRaw") \

View File

@ -850,6 +850,15 @@ B fromUtf8_c1(B t, B x) {
return r;
}
B toUtf8_c1(B t, B x) {
if (!isArr(x)) thrM("•ToUTF8: Argument must be a character or number array");
u64 len = utf8lenB(x);
u8* rp; B r = m_c8arrv(&rp, len);
toUTF8(x, (char*)rp);
dec(x);
return r;
}
extern char** environ;
#if __has_include(<spawn.h>) && __has_include(<sys/wait.h>) && !WASM