You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently require with arguments is supposed to import specified symbols into its lexical scope. The thing which is not specified in the documentation is that the symbols are treated as variables. What happens then is that if a role is requested for import:
require ("module.pm") <a_role>;
rakudo installs a same-name variable a_role. I wonder if its a legit behavior or not? On one hand, we could allow only sigiled entities to import. But this would effectively cut off constants. Though they're not correctly imported now anyway.
Another way is to allow sigilless symbols to be required. But this needs installing a symbol stub which could be resolved at run-time by REQUIRE_IMPORT. So far, I didn't find a way how this could be done.
The text was updated successfully, but these errors were encountered:
Followup to rakudo/rakudo#2983.
Currently
require
with arguments is supposed to import specified symbols into its lexical scope. The thing which is not specified in the documentation is that the symbols are treated as variables. What happens then is that if a role is requested for import:rakudo installs a same-name variable
a_role
. I wonder if its a legit behavior or not? On one hand, we could allow only sigiled entities to import. But this would effectively cut off constants. Though they're not correctly imported now anyway.Another way is to allow sigilless symbols to be
require
d. But this needs installing a symbol stub which could be resolved at run-time byREQUIRE_IMPORT
. So far, I didn't find a way how this could be done.The text was updated successfully, but these errors were encountered: