help function displays values not

Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
Ava Hahn 2023-03-06 15:12:59 -08:00
parent 8d79037d4d
commit de29bbf950
Signed by untrusted user who does not match committer: affine
GPG key ID: 3A4645B8CF806069
6 changed files with 127 additions and 103 deletions

View file

@ -222,6 +222,23 @@ impl fmt::Display for Args {
}
}
impl fmt::Display for ValueType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ValueType::VarForm(ref s) => write!(f, "{}", s),
ValueType::Internal(_) => write!(f, "<builtin>"),
ValueType::FuncForm(ref form) => {
write!(f, "args: ")?;
for sym in form.arg_syms.clone() {
write!(f, "{} ", sym)?;
}
write!(f, "\nform: {}", form.ast)?;
Ok(())
},
}
}
}
impl Symbol {
/* call
* routine is called by eval when a symbol is expanded