Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(transient): adds conj!, assoc!, dissoc! and pop! for transients #62

Merged
merged 7 commits into from
Mar 22, 2024

Conversation

Samy-33
Copy link
Contributor

@Samy-33 Samy-33 commented Mar 16, 2024

No description provided.

@Samy-33 Samy-33 force-pushed the transient-vector-fns branch from ac13d76 to 78ad135 Compare March 16, 2024 08:17
@Samy-33 Samy-33 force-pushed the transient-vector-fns branch from 78ad135 to b5c4338 Compare March 16, 2024 08:19
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Attention: Patch coverage is 89.90536% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 59.54%. Comparing base (c41ff94) to head (8ab39ce).
Report is 19 commits behind head on transient.

❗ Current head 8ab39ce differs from pull request most recent head b25c901. Consider uploading reports for the commit b25c901 to get more accurate results

Files Patch % Lines
src/cpp/jank/util/escape.cpp 71.92% 16 Missing ⚠️
src/cpp/jank/runtime/obj/transient_vector.cpp 0.00% 5 Missing ⚠️
src/cpp/jank/analyze/processor.cpp 85.18% 4 Missing ⚠️
src/cpp/jank/read/parse.cpp 92.59% 4 Missing ⚠️
src/cpp/jank/runtime/obj/transient_hash_map.cpp 0.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           transient      #62      +/-   ##
=============================================
- Coverage      61.29%   59.54%   -1.75%     
=============================================
  Files             52       55       +3     
  Lines           7926     7655     -271     
=============================================
- Hits            4858     4558     -300     
- Misses          3068     3097      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/jank/clojure/core.jank Outdated Show resolved Hide resolved
@Samy-33 Samy-33 changed the title feat(transient): adds conj!, assoc! and dissoc! for transients feat(transient): adds conj!, assoc!, dissoc! and pop! for transients Mar 17, 2024
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
([coll x]
(native/raw "__value = visit_object
(
[=](auto const typed_t, auto const head) -> object_ptr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these were changed from [&] to [=], but I think they can be []. Did you hit an issue with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the compiler's mad at me:

➜  jank git:(transient-vector-fns) ✗ ./bin/compile
[1/1] Generating classes/core-libraries
input_line_94:18:29: error: variable 'call_574' cannot be implicitly captured in a lambda with no capture-default specified
                    { throw call_574; }
                            ^
input_line_94:9:243: note: 'call_574' declared here
        jank::profile::timer __timer{ "dissoc_BANG__558" };auto const map_575(jank::make_box<jank::runtime::obj::persistent_array_map>(jank::runtime::detail::in_place_unique{}, jank::make_array_box<object_ptr>(const_561, coll),2));auto const call_574(jank::runtime::dynamic_call(ex_info_559->deref(), const_560, map_575));object_ptr native_573{ obj::nil::nil_const() };{ object_ptr __value{ obj::nil::nil_const() };__value = visit_object
                                                                                                                                                                                                                                                  ^
input_line_94:11:19: note: lambda expression begins here
                  [](auto const typed_t, auto const key) -> object_ptr
                  ^
input_line_94:11:20: note: capture 'call_574' by value
                  [](auto const typed_t, auto const key) -> object_ptr
                   ^
                   call_574

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's because you're throwing coll instead of typed_coll. Since you have the fully typed version as the first param to the lambda, we can use that rather than also capturing the erased version.

src/jank/clojure/core.jank Outdated Show resolved Hide resolved
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
@Samy-33 Samy-33 force-pushed the transient-vector-fns branch from 9d89d8e to fcf48b2 Compare March 22, 2024 16:40
@Samy-33 Samy-33 force-pushed the transient-vector-fns branch from fcf48b2 to 8ab39ce Compare March 22, 2024 16:57
src/jank/clojure/core.jank Outdated Show resolved Hide resolved
@jeaye jeaye merged commit 250a33e into jank-lang:transient Mar 22, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants