Fix the build, but List.dropLast itself still doesn't work.

This commit is contained in:
Chelsea Troy 2021-10-23 00:29:13 -05:00
parent fd83c3b749
commit 9633a5adaa
No known key found for this signature in database
GPG key ID: A631885A970636C2
2 changed files with 6 additions and 1 deletions

View file

@ -88,6 +88,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
LIST_MAP3 => list_map3,
LIST_DROP => list_drop,
LIST_DROP_AT => list_drop_at,
LIST_DROP_LAST => list_drop_last,
LIST_SWAP => list_swap,
LIST_MAP_WITH_INDEX => list_map_with_index,
LIST_KEEP_IF => list_keep_if,
@ -2007,6 +2008,11 @@ fn list_drop_at(symbol: Symbol, var_store: &mut VarStore) -> Def {
/// List.dropLast: List elem -> List elem
fn list_drop_last(symbol: Symbol, var_store: &mut VarStore) -> Def {
let list_var = var_store.fresh();
let index_var = var_store.fresh();
let arg_var = var_store.fresh();
let len_var = Variable::NAT;
let num_var = len_var;
let num_precision_var = Variable::NATURAL;
let body = RunLowLevel {
op: LowLevel::ListDropAt,