The Wayback Machine - https://web.archive.org/web/20200621140930/https://github.com/carp-lang/Carp/issues/467
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

Prevent usage of functions marked as private outside of their module #467

Open
hellerve opened this issue May 29, 2019 · 0 comments
Open

Prevent usage of functions marked as private outside of their module #467

hellerve opened this issue May 29, 2019 · 0 comments
Assignees
Labels
bug

Comments

@hellerve
Copy link
Member

@hellerve hellerve commented May 29, 2019

Currently, marking a function as private is purely informative. Ideally, the compiler should enforce that the function isn’t used outside that module. It should also cover interesting cases like:

(defmodule T
  (private f)
  (defn f [] (println* "I can’t be called outside!))
)
(T.f) ; this should fail
(defmodule T
  (defn f2 [] (f)) ; this should work, since it’s inside the module, though in a different form
)

Cheers

@eriksvedang eriksvedang self-assigned this May 30, 2019
@eriksvedang eriksvedang added bug and removed enhancement labels May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.