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

패키지의 함수로 노출해야 하는 rust 함수 이름 앞에 프리픽스를 추가합니다. #9

Open
mrchypark opened this issue Jul 11, 2022 · 0 comments

Comments

@mrchypark
Copy link
Member

extendr/extendr#422

위 이슈로 인해 아직 rust내의 문서로 함수 export를 지원하지 않는 것 같습니다.
그렇다면 r 코드 내에서 export 하기 위한 래핑 함수를 작성함에 있어, 실제 노출시키려는 함수 이름과 겹치는 문제가 발생합니다.

예를 들어 str_length 를 rust 함수로 만들어 #[extendr] 를 붙이는 경우 r 코드내에서도 str_length로 생성되는데, 이 부분이 내부 함수로 작성됩니다.
그렇기 때문에 내부함수로 작성될 함수 이름을 노출될 함수이름과 같게 만들어야하는 문제가 생깁니다.
그렇기에 rust내에 str_length 함수는 rust_str_length 든 프리픽스를 추가하고,

str_length <- function(...) {
rust_str_length(...)
}

처럼 감싸면 좋을 것 같습니다.

물론 이상적인 것은 rust 함수쪽에서 문서화를 진행할 때 export를 결정할 수 있으면 가장 좋습니다.

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

No branches or pull requests

1 participant