--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/eb89b3b5-5c18-40d0-b05e-f83fe5ff9713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I am wondering if this would be better done as a post-processing step.
There is a lot of information we can get from post processing:
1. A module that was not defined anywhere is being called.
2. A function with @doc false is not being called
3. A function in a module with @moduledoc false is not being called (as you posted)
There is one issue though. For example, the functions in Kernel.Utils are sometimes called by generated code. This means xref would warn such cases and it would be a false positive.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/X18SZnSDW7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4L9ZyAr7R7JdOPtP%2B8oKGphUW0nn05DX_242vre4x-GdA%40mail.gmail.com.
Your mention of `@doc false` and `@moduledoc false` is interesting. We could perhaps implement this feature using just those, with no need for the introduction of a new macro. But I think it would perhaps be surprising to end-users if `@doc false` and `@moduledoc false` triggered these warnings as those attributes seem to be only about documentation, and not privateness.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/X18SZnSDW7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LiiV6sFyYGde2FXCpzHRoOVLT3gGEgazwpaenTpa5UMA%40mail.gmail.com.
Interesting. If we implemented something akin to that `export_to` proposal, I guess the feature would apply at the individual function level instead of at the module level: essentially defining a function's visibility to be limited to the project in which it is defined. This makes me think a bit of C++'s `friend` scope. (I don't think I like the name "friend" for this, though.)
def foo doBar.bazend
1. Provide a @export_to that works as an attribute. The compiler won't check it isn't violated but a post-compiler check may.
2. Effectively implement something like "defmodulep" that would slightly change the semantics of its defined functions but ensure a strict compile time and runtime access.
The macro foo/2 would check if the __CALLER__.module belongs to the allowed exports and emit an AST that calls "(export) foo"/2 with the exactly same arguments
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/X18SZnSDW7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LNxw8UfrE8QaLUqMq%3Da-%2BH3k9JQg7aaNrqZrTyQFpnyA%40mail.gmail.com.
How would it now what the allowed exports are? (Or is this meant to work in conjunction with `@export_to`?)
Also, putting parens in a function name seems kinda weird. Maybe `__exported_foo/2` would be better? Or `__private_foo/2`.
Would this approach allow depending projects to call the private module's function using `ModName.__exported_foo`?
It seems odd to have both @export_to
and defmodulep
— the fact that they are individually available suggests someone could use one but not the other, which would be quite confusing. Would this work?
defmodule MyLib.PrivateHelpers do
@private_module export_to: MyLib.*
# ...
end
Basically, combine them into a single, one-line declaration. It also perhaps solves the issue of defmodulep
implying something about the module that is not true. The export_to
option passed when declaring @private_module
makes the behavior of the privateness explicit.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/X18SZnSDW7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KjL5we7qTfyJxk8VMDLJ-h7KVKtjkBy3MDjvDmrUMsow%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CADUxQmuaXUUudTD4UxXLCFM9xkv2iJV8qNwRpkOybdAqW2Nppg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JiaZQuSbQzuNjX2iBy0CdW%3DWowWr2FG3KKYTWDD5Qz8g%40mail.gmail.com.