diff --git a/Readme.org b/Readme.org index 3e98801..22739a6 100644 --- a/Readme.org +++ b/Readme.org @@ -139,8 +139,8 @@ This contains any executable target of this project. Notably the main shell file Note: this section will not show the status of each item unless you are viewing it with a proper orgmode viewer. Note: this section only tracks the state of incomplete TODO items. Having everything on here would be cluttered. +*** TODO Eval function *** TODO Input function -*** TODO Env function *** TODO Load (load a script) function Pull/Refactor the logic out of the configure functions. Optionally return a list of new variables and/or functions? diff --git a/src/stl.rs b/src/stl.rs index b2c82d3..b0a4907 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -215,7 +215,8 @@ pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> { Ok(()) } -pub const ECHO_DOCSTRING: &str = "traverses any number of arguments. Prints their evaluated values on a new line for each."; +pub const ECHO_DOCSTRING: &str = + "traverses any number of arguments. Prints their evaluated values on a new line for each."; fn _echo_callback(ast: &Seg, _syms: &mut SymTable) -> Result { if ast.len() == 1 { diff --git a/src/stl/boolean.rs b/src/stl/boolean.rs index e269539..1b2a99e 100644 --- a/src/stl/boolean.rs +++ b/src/stl/boolean.rs @@ -17,7 +17,8 @@ use crate::segment::{Ctr, Seg}; use crate::sym::{SymTable, ValueType}; -pub const AND_DOCSTRING: &str = "traverses a list of N arguments, all of which are expected to be boolean. +pub const AND_DOCSTRING: &str = + "traverses a list of N arguments, all of which are expected to be boolean. starts with arg1 AND arg2, and then calculates prev_result AND next_arg. returns final result."; @@ -40,7 +41,8 @@ pub fn and_callback(ast: &Seg, _syms: &mut SymTable) -> Result { } } -pub const OR_DOCSTRING: &str = "traverses a list of N arguments, all of which are expected to be boolean. +pub const OR_DOCSTRING: &str = + "traverses a list of N arguments, all of which are expected to be boolean. starts with arg1 OR arg2, and then calculates prev_result OR next_arg. returns final result."; @@ -89,7 +91,6 @@ pub const TOGGLE_DOCSTRING: &str = "switches a boolean symbol between true or fa Takes a single argument (a symbol). Looks it up in the variable table. Either sets the symbol to true if it is currently false, or vice versa."; - pub fn toggle_callback(ast: &Seg, syms: &mut SymTable) -> Result { let var_name: String; if let Ctr::Symbol(ref s) = *ast.car { diff --git a/src/stl/control.rs b/src/stl/control.rs index f62ee62..6c2c7ae 100644 --- a/src/stl/control.rs +++ b/src/stl/control.rs @@ -19,7 +19,8 @@ use crate::eval::eval; use crate::segment::{Ctr, Seg}; use crate::sym::{Args, SymTable, Symbol, ValueType}; -pub const IF_DOCSTRING: &str = "accepts three bodies, a condition, an unevaluated consequence, and an alternative consequence. +pub const IF_DOCSTRING: &str = + "accepts three bodies, a condition, an unevaluated consequence, and an alternative consequence. If the condition is evaluated to true, the first consequence is evaluated. If the condition is evaluated to false, the second consequence is evaluated. Otherwise, an error is thrown. @@ -94,7 +95,7 @@ pub fn if_callback(ast: &Seg, syms: &mut SymTable) -> Result { } } -pub const LET_DOCSTRING: &str = "creates a stack of local variables for a sequence of operations. +pub const LET_DOCSTRING: &str = "creates a stack of local variables for a sequence of operations. returns the result of the final operation. example: (let ((step1 'hello') diff --git a/src/stl/decl.rs b/src/stl/decl.rs index 17a9ab7..735b81d 100644 --- a/src/stl/decl.rs +++ b/src/stl/decl.rs @@ -200,7 +200,7 @@ pub fn env_callback(_ast: &Seg, syms: &mut SymTable) -> Result { match val.value { ValueType::VarForm(_) => { println!(" {}: {}", &name, val.value); - }, + } _ => functions.push(name.clone()), } } diff --git a/src/sym.rs b/src/sym.rs index 077d0fc..876ee17 100644 --- a/src/sym.rs +++ b/src/sym.rs @@ -238,7 +238,7 @@ impl fmt::Display for ValueType { } write!(f, "\nform: {}", form.ast)?; Ok(()) - }, + } } } }