help function displays values not
Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
parent
8d79037d4d
commit
de29bbf950
6 changed files with 127 additions and 103 deletions
17
src/sym.rs
17
src/sym.rs
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue