From df282764960ffa14f7556ae9099e5b46c338a1c3 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sat, 26 Sep 2026 10:46:17 +0100 Subject: [PATCH] Write about REPL module and demo program in development log --- LOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/LOG.md b/LOG.md index 659ed23..125cbe1 100644 --- a/LOG.md +++ b/LOG.md @@ -129,3 +129,17 @@ serialisations. The printing logic could then be packaged up in an implementation of the Rust standard library's `Display` trait, which is for types that have a textual representation. + +## REPL + +At this point, with the reading and printing implemented, it made +sense to create the REPL logic and demo binary so that a full flow +through the program could be demonstrated. I first created an +`Evaluator` trait to capture the future behaviour of the evaluator, +and then wrote a generic REPL module that's able to work with any +expression type implementing the `FromStr` and `Display` traits. + +I was then able to create a demo program by defining a dummy evaluator +that simply returns the input expression unmodified, and running a +REPL using that, connected to stdin and stdout. This demonstrated a +full round trip through the parsing and printing procedures.