Register function with namespace
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 54/100
Hướng nghiên cứu
Start in R/register.R at the wrapper-generation code linked in the issue, then trace how decor records namespaced functions and how R-side functions are generated. Add or extend tests for registering foo::bar and verify that the generated extern "C" wrapper and R-side function use valid names. The existing comparison branch may provide useful context.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When registering a function in a namespace such as
[[cpp11::register]] int foo::bar(int a) {
return a;
}
decor recognizes the function name as foo::bar and all would be fine (as far as I can tell), if the generated extern "C" wrapper
https://github.com/r-lib/cpp11/blob/c22dc9b611fe7d56ddfc57add2e01b1424869c0f/R/register.R#L171-L176
would not blindly forward the ::. Some further minor adjustments are required for the generation of the R-side functions. For the R-side function name, we could for example strip away anything that comes before the last scope resolution operator.
I started putting something together under https://github.com/r-lib/cpp11/compare/main...nbenn:main and I'm happy to clean this up a bit, add some tests and submit a PR.
- Ngôn ngữ chính
- C++
- Star
- 224
- Fork
- 52
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của r-lib/cpp11
-
Dimension error with `r_vector` Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AXERA-TECH/ax-llm#77 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
games-on-whales/wolf#509 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
bug-unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100