Skip to content

Commit

Permalink
Remove old append
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Oct 27, 2022
1 parent d360774 commit 40981ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions dsk/lib/lisp/core.lsp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@
(f (first ls))
(map f (rest ls)))))

(def (append x y)
(if (nil? x) y
(cons (first x) (append (rest x) y))))

(def (reverse x)
(if (nil? x) x
(append (reverse (rest x)) (cons (first x) '()))))
Expand Down
6 changes: 3 additions & 3 deletions src/usr/lisp/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ pub fn default_env() -> Rc<RefCell<Env>> {
_ => Err(Err::Reason("Expected arg to be a number".to_string()))
}
}));
data.insert("list".to_string(), Exp::Primitive(|args: &[Exp]| -> Result<Exp, Err> {
Ok(Exp::List(args.to_vec()))
}));
data.insert("parse".to_string(), Exp::Primitive(|args: &[Exp]| -> Result<Exp, Err> {
ensure_length_eq!(args, 1);
let s = string(&args[0])?;
let (_, exp) = parse(&s)?;
Ok(exp)
}));
data.insert("list".to_string(), Exp::Primitive(|args: &[Exp]| -> Result<Exp, Err> {
Ok(Exp::List(args.to_vec()))
}));
data.insert("append".to_string(), Exp::Primitive(|args: &[Exp]| -> Result<Exp, Err> {
let mut res = vec![];
for arg in args {
Expand Down

0 comments on commit 40981ee

Please sign in to comment.