add reverse, snippet for prepend implementation
This commit is contained in:
parent
6961fcc9fa
commit
928c9b91ed
6 changed files with 288 additions and 25 deletions
33
src/stl.rs
33
src/stl.rs
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue