add append function

This commit is contained in:
Aidan Hahn 2021-11-02 19:05:35 -07:00
parent 37eba3008f
commit ee3b53bfb5
No known key found for this signature in database
GPG key ID: 327711E983899316
5 changed files with 79 additions and 3 deletions

View file

@ -21,6 +21,8 @@ use crate::segment::{Ctr, Ast, circuit, ast_as_string};
use std::rc::Rc;
use std::cell::RefCell;
// Current primitive is to use a get_NNNNN function defined for each library function which returns a not-previously-owned
// copy of the Function struct.
pub fn get_echo() -> Function {
return Function{
name: String::from("echo"),
@ -44,8 +46,7 @@ pub fn get_echo() -> Function {
string.push_str("\n");
return true;
}) {
// TODO: use custom logger
println!("Echo failure!")
eprintln!("circuit loop in echo should not have returned false")
}
return Ctr::String(string);
}