Skip to content

Commit

Permalink
Predefine do_insert instead of do_delete in erlang_extraction
Browse files Browse the repository at this point in the history
Because writing the insert function is the second task,
I think it's more beneficial as a hint to predefine the private do_ function there
so that beginners are not stuck on the different order of arguments.
And then we can let the student figure this out on their own for the delete function
  • Loading branch information
michallepicki authored and lpil committed Sep 18, 2023
1 parent 17803e3 commit 2f994e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ pub fn insert(tree: GbTree(k, v), key: k, value: v) -> GbTree(k, v) {
todo
}

pub fn delete(tree: GbTree(k, v), key: k) -> GbTree(k, v) {
fn do_insert(key: k, value: v, tree: GbTree(k, v)) -> GbTree(k, v) {
todo
}

fn do_delete(key: k, tree: GbTree(k, v)) -> GbTree(k, v) {
pub fn delete(tree: GbTree(k, v), key: k) -> GbTree(k, v) {
todo
}

0 comments on commit 2f994e3

Please sign in to comment.