Skip to content

Commit

Permalink
Fix C API = impl to visit seqable
Browse files Browse the repository at this point in the history
  • Loading branch information
jeaye committed Nov 29, 2024
1 parent d1b4e24 commit e4f9653
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions compiler+runtime/src/cpp/clojure/core_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,20 @@ jank_object_ptr jank_load_clojure_core_native()
return obj::boolean::false_const();
}

for(auto it(fresh_seq(rest)); it != nullptr; it = next_in_place(it))
{
if(!equal(l, first(it)))
{
return obj::boolean::false_const();
}
}

return obj::boolean::true_const();
return visit_seqable(
[](auto const typed_rest, object_ptr const l) {
for(auto it(typed_rest->fresh_seq()); it != nullptr; it = it->next_in_place())
{
if(!equal(l, it->first()))
{
return obj::boolean::false_const();
}
}

return obj::boolean::true_const();
},
rest,
l);
};
intern_fn_obj("=", fn);
}
Expand Down

0 comments on commit e4f9653

Please sign in to comment.