add reverse, snippet for prepend implementation

This commit is contained in:
Ava Hahn 2023-03-08 20:59:22 -08:00
parent 6961fcc9fa
commit 928c9b91ed
Signed by untrusted user who does not match committer: affine
GPG key ID: 3A4645B8CF806069
6 changed files with 288 additions and 25 deletions

View file

@ -338,6 +338,39 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
},
);
syms.insert(
"pop".to_string(),
Symbol {
name: String::from("pop"),
args: Args::Strict(vec![Type::Seg]),
conditional_branches: false,
docs: append::POP_DOCSTRING.to_string(),
value: ValueType::Internal(Rc::new(append::pop_callback)),
},
);
syms.insert(
"dq".to_string(),
Symbol {
name: String::from("dequeue"),
args: Args::Strict(vec![Type::Seg]),
conditional_branches: false,
docs: append::DEQUEUE_DOCSTRING.to_string(),
value: ValueType::Internal(Rc::new(append::dequeue_callback)),
},
);
syms.insert(
"reverse".to_string(),
Symbol {
name: String::from("reverse"),
args: Args::Strict(vec![Type::Seg]),
conditional_branches: false,
docs: append::REVERSE_DOCSTRING.to_string(),
value: ValueType::Internal(Rc::new(append::reverse_callback)),
},
);
syms.insert(
"exp".to_string(),
Symbol {