-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Silent namespace and mixins unlocking #2093
Comments
A silent namespace is just a mixin containing a mixin definition is it not? |
Yes, I would also remind and stress the fact that "namespace" is just an abstraction. "Silent namespace" is just an ordinal parametric mixin, same way as a "non-silent" namespace is just an ordinal non-parametric one :). I.e. we should not invent any special "namespace" rules beside the core "invoke namespace child" syntax, and all the rest, i.e. variables and mixins visibility, scope and unlocking, should follow "standard" "mixin nested within a mixin" stuff. P.S. I can't find similar issue (with |
After some thinking, I guess this is an expected behaviour. Non-parametric P.S. Ah, found it: it's closely related to #1525, and it also has been discussed in #1812. So btw., #1525 looks like something to be fixed right after #2180 (if we want it to). Btw. and just in case, all this does not render "parametric namespaces" to be useless as they may seem to be... They still remain pretty interesting and potentially quite valuable entity (especially counting weve got this for free :) if used as in (1) or (2). It's just more close to (classical OOP) classes/objects rather than namespaces. |
@seven-phases-max I think that your last comment amounts to "it works as currently implemented therefore it works correctly" :). I did not knew silent namespaces are accidental. I did not questioned less.js a year ago. I used to assume that less.js is bug free and everything works as designed. I even ported couple of suspicious "features" into less4j you later fixed as bugs. Silent namespaces were mentioned somewhere in some issue comment, worked, therefore they must have been a feature designed from the start. |
Yes, sort of... it sounds like so, but actually it is the opposite: "it works correctly because it's implemented correctly" (even if by accident), or in other words: it works correctly because it is supposed to work so (and not the other way (imho of course)). In summary: internals of a parametric mixin should not be considered until this mixin is actually invoked. Hence The following example is actually equal in terms of visibility (to illustrate the "heavy" part):
For this to work we would need to either expose So I'd rather support |
Hmm, and thinking of it more in context of the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Should silent namespace (e.g. namespace declared with parentheses
()
) behave the same way as normal ruleset namespaces? I can not find silent namespace in docs, so maybe they should not exist at all?Ruleset-namespace:
compiles into:
Silent namespace:
returns an error:
The text was updated successfully, but these errors were encountered: