aboutsummaryrefslogtreecommitdiff
path: root/src/sexp/step.rs
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-06 17:05:55 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-06 17:05:55 +0300
commit3e1bf7f9946efe70d452c71494ac77ed39110804 (patch)
treef7682f538db9d8b77890e8c0e9c54eb2968d4388 /src/sexp/step.rs
parent313c044b4a878a425aaca6554576f5154ace8ff9 (diff)
downloadmyslip-3e1bf7f9946efe70d452c71494ac77ed39110804.tar.gz
myslip-3e1bf7f9946efe70d452c71494ac77ed39110804.zip
Added print, raised level on which UnboundGeneric error is returned
Diffstat (limited to 'src/sexp/step.rs')
-rw-r--r--src/sexp/step.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sexp/step.rs b/src/sexp/step.rs
index 816582c..94f6381 100644
--- a/src/sexp/step.rs
+++ b/src/sexp/step.rs
@@ -309,6 +309,21 @@ impl SExp {
None => panic!("unreachable as per match guard arm"),
},
+ // prints
+ SCons(op, l) if op.clone().is_print() => match *op {
+ SCons(_, b) => {
+ println!("{}", match *b {
+ SCons(a, b) if *b == Atom(Nil) => *a,
+ t => t,
+ });
+ Ok(match *l {
+ SCons(a, b) if *b == Atom(Nil) => *a,
+ t => t
+ })
+ },
+ Atom(_) => panic!("unreachable as per match arm guard"),
+ },
+
// op value and a1 .. an values, and b0, b1 .. bn not values
// ---------------------------------------------------------