forked from Orchid/orchid
partway towards commands
I got very confused and started mucking about with "spawn" when in fact all I needed was the "inline" extension type in orcx that allows the interpreter to expose custom constants.
This commit is contained in:
@@ -2,12 +2,9 @@ use std::borrow::Cow;
|
||||
|
||||
use orchid_api_derive::{Coding, Hierarchy};
|
||||
use orchid_api_traits::Request;
|
||||
use orchid_base::error::mk_errv;
|
||||
use orchid_base::interner::{es, is};
|
||||
use orchid_base::name::{NameLike, Sym};
|
||||
use orchid_base::reqnot::ReqHandleExt;
|
||||
use orchid_extension::atom::{Atomic, Supports, TAtom};
|
||||
use orchid_extension::atom_owned::{OwnedAtom, OwnedVariant, own};
|
||||
use orchid_base::{NameLike, ReqHandleExt, Sym, es, is, mk_errv};
|
||||
use orchid_extension::{Atomic, Supports, TAtom};
|
||||
use orchid_extension::{OwnedAtom, OwnedVariant};
|
||||
use orchid_extension::expr::{Expr, ExprHandle};
|
||||
use orchid_extension::gen_expr::new_atom;
|
||||
use orchid_extension::system::sys_req;
|
||||
@@ -33,9 +30,9 @@ impl OwnedAtom for SymAtom {
|
||||
impl Supports<ToStringMethod> for SymAtom {
|
||||
async fn handle<'a>(
|
||||
&self,
|
||||
hand: Box<dyn orchid_base::reqnot::ReqHandle<'a> + '_>,
|
||||
hand: Box<dyn orchid_base::ReqHandle<'a> + '_>,
|
||||
req: ToStringMethod,
|
||||
) -> std::io::Result<orchid_base::reqnot::Receipt<'a>> {
|
||||
) -> std::io::Result<orchid_base::Receipt<'a>> {
|
||||
hand.reply(&req, &self.0.to_string()).await
|
||||
}
|
||||
}
|
||||
@@ -66,7 +63,7 @@ pub async fn gen_sym_lib() -> Vec<GenMember> {
|
||||
}
|
||||
}),
|
||||
fun(true, "to_tpl", async move |sym: TAtom<SymAtom>| {
|
||||
HomoTpl(own(&sym).await.0.segs().map(|seg| new_atom(IntStrAtom(seg))).collect())
|
||||
HomoTpl(sym.own().await.0.segs().map(|seg| new_atom(IntStrAtom(seg))).collect())
|
||||
}),
|
||||
])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user