repl_framework 0.3.0

A crate to easily create simple repls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use repl_framework::Repl;
fn main() -> std::io::Result<()> {
    Repl::default().with_function("", reverse).run()
}
#[derive(Default)]
struct Data;

// function to reverse string
fn reverse(_: &mut Data, strings: Vec<String>) {
    let mut outstring = String::new();
    strings.into_iter().for_each(|string| {
        string.chars().rev().for_each(|f| outstring.push(f));
        outstring += " ";
    });
    println!("{}", outstring);
}