From a2ca4c08dcbb5c08e210bc741141290a136a8de4 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 9 Aug 2025 21:39:45 +0300 Subject: Implemented print as ? -> () --- src/sexp/display.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sexp/display.rs') diff --git a/src/sexp/display.rs b/src/sexp/display.rs index c3db144..a978f61 100644 --- a/src/sexp/display.rs +++ b/src/sexp/display.rs @@ -27,6 +27,7 @@ impl fmt::Display for SLeaf { Var(s) => s.to_string(), Quote => "quote".to_string(), Vector => "vector".to_string(), + Print => "print".to_string(), Let => "let".to_string(), Nil => "()".to_string(), }) @@ -40,6 +41,7 @@ impl fmt::Display for SExp { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Atom(leaf) => write!(f, "{}", leaf.to_string()), + SCons(a, b) if **b == Atom(Nil) => (*a).fmt(f), SCons(a, b) => write!( f, -- cgit v1.2.3