-
Hello, again! Recently I noticed that using an alias resulted in importing more than was specified in the brackets, but not an using alias only imported what was specified. I didn't want to open an issue if this is expected behavior and I misunderstood the documentation. Q: Is this behavior in example 2 expected? Example 1: without alias
Example 2: with alias
output from
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, this is intentional, and explicitly documented behaviour: the stuff in square brackets is the attach specification; it controls what names are attached, not what names are present inside the module alias (and restricting that list wouldn’t be useful anyway). However, there’s some lax wording in the documentation that might be misleading, I will change that: The list can also contain the special symbol ..., which causes all
-exported names of the module/package to be imported.
+exported names of the module/package to be attached. (Note that |
Beta Was this translation helpful? Give feedback.
“attach” in the context of ‘box’ means the same as it does in R generally. That is: make a name available in the current scope directly, without the need to explicitly qualify their package/module name.
The difference is that the first one only attaches
chuck()
, the second attaches all exports of the ‘purrr’ package:In fact, the presence of the module alias (
foo =
) is unrelated to the question of what nam…