Protocols and operators mostly
All checks were successful
Rust / build (push) Successful in 4m8s

This commit is contained in:
2026-01-21 22:22:58 +01:00
parent 75b05a2965
commit f38193edcc
33 changed files with 578 additions and 147 deletions

View File

@@ -7,12 +7,12 @@ use orchid_extension::conv::ToExpr;
use orchid_extension::coroutine_exec::exec;
use orchid_extension::expr::Expr;
use orchid_extension::gen_expr::{call, sym_ref};
use orchid_extension::tree::{GenMember, cnst, comments, fun, prefix};
use orchid_extension::tree::{GenMember, comments, fun, prefix};
use super::str_atom::StrAtom;
use crate::OrcString;
use crate::std::protocol::types::get_impl;
use crate::std::string::to_string::{AsStrTag, ToStringMethod};
use crate::std::protocol::types::{get_impl, proto};
use crate::std::string::to_string::ToStringMethod;
pub fn gen_str_lib() -> Vec<GenMember> {
prefix("std::string", [
@@ -45,15 +45,6 @@ pub fn gen_str_lib() -> Vec<GenMember> {
.await
}),
),
prefix("to_string", [
cnst(true, "__type_tag__", AsStrTag),
fun(true, "resolve", async |atom: ForeignAtom| {
exec(async |mut h| {
let proto = h.exec(sym_ref(sym!(std::string::to_string))).await?;
Ok(call(get_impl(atom.clone(), proto).await?.to_gen().await, [atom.to_gen().await]))
})
.await
}),
]),
proto(true, "to_string").finish(),
])
}