Visibility Modifiers
Cangjie provides four access modifiers to control the visibility of declarations: private, internal, protected, and public.
private makes declarations visible only within the current file, suitable for implementation details and helper functions. internal is the default value, making declarations visible within the current package and its subpackages. protected restricts visibility to the current module, while public makes declarations visible to all packages.
The code on the right demonstrates the usage of all four modifiers. Note that within the same file, all declarations are accessible regardless of the modifier used. Visibility restrictions only apply across files or packages.
import statements is private, meaning imported names are only available in the current file. If you want imports to be visible throughout the package, you need to explicitly declare public import.Try changing secretHelper from private to other modifiers to understand the scope of different visibility levels.