@@ -8,23 +8,23 @@ order: 4
88
99# Access Modifiers
1010
11- > [ !WARNING]
12- > Everybody who ever maintained a large system knows [ encapsulation is essential] ( ../semantics/encapsulation.md ) .
11+ > [ !WARNING] Everybody who ever maintained a large system knows
12+ > [ encapsulation is essential] ( ../semantics/encapsulation.md ) .
1313>
14- > While we don't usually like making things private in a programming language, it
15- > sometimes the case that it is necessary to indicate that certain fields should
16- > not be touched (as this might break invariants and such like). To this end, Enso
17- > provides an explicit mechanism for access modification.
14+ > While we don't usually like making things private in a programming language,
15+ > it sometimes the case that it is necessary to indicate that certain fields
16+ > should not be touched (as this might break invariants and such like). To this
17+ > end, Enso provides an explicit mechanism for access modification.
1818
1919Enso targets large user base of _ non-programmers_ . They are mostly focused on
20- getting their job done and [ encapsulation] ( ../semantics/encapsulation.md ) of their own code is the last thing
21- that comes to their mind.
20+ getting their job done and [ encapsulation] ( ../semantics/encapsulation.md ) of
21+ their own code is the last thing that comes to their mind.
2222
23- On the other hand, Enso supports and encourages creation of * sharable libraries * .
24- Maintainers of such libraries are likely to treat API design and its
25- backward compatibility seriously. As such they need a way to [ encapsulate ] ( ../semantics/encapsulation.md )
26- internals of their libraries and clearly * differentiate public API * and
27- implementations details.
23+ On the other hand, Enso supports and encourages creation of _ sharable
24+ libraries _ . Maintainers of such libraries are likely to treat API design and its
25+ backward compatibility seriously. As such they need a way to
26+ [ encapsulate ] ( ../semantics/encapsulation.md ) internals of their libraries and
27+ clearly _ differentiate public API _ and implementations details.
2828
2929<!-- MarkdownTOC levels="2,3" autolink="true" -->
3030
@@ -35,27 +35,26 @@ implementations details.
3535
3636## Access Modification
3737
38- * By default * Enso elements (functions, types, methods) are * public * .
39- One has to use an access modifier to hide and [ encapsulate] ( ../semantics/encapsulation.md ) them. The
40- reasoning is: those who don't care can access everything they create without
41- any restriction. Those who care can make things ` private ` with an additional
42- effort.
38+ _ By default _ Enso elements (functions, types, methods) are _ public _ . One has to
39+ use an access modifier to hide and [ encapsulate] ( ../semantics/encapsulation.md )
40+ them. The reasoning is: those who don't care can access everything they create
41+ without any restriction. Those who care can make things ` private ` with an
42+ additional effort.
4343
44+ Accessing any member under an access modifier is an error when performed from
45+ another project. Such a check is enforced during runtime.
4446
45- Accessing any member under an access modifier is an error when performed from another project.
46- Such a check is enforced during runtime.
47-
48- There is a command line switch to _ disable access modifier check_ .
49- It maybe be useful for experimentation. However the general suggestion is:
50- Avoid using it in production.
47+ There is a command line switch to _ disable access modifier check_ . It maybe be
48+ useful for experimentation. However the general suggestion is: Avoid using it in
49+ production.
5150
5251## Private
5352
5453Encapsulation is an effective _ communication mechanism_ among _ distributed
55- groups_ of developers. The ` private ` modifier hides implementation details from clients of the API.
56- The primary groups in the Enso case are those who * publish a library *
57- and those who * consume such a library * .
54+ groups_ of developers. The ` private ` modifier hides implementation details from
55+ clients of the API. The primary groups in the Enso case are those who _ publish a
56+ library _ and those who _ consume such a library _ .
5857
59- As such Enso supports _ library private_ encapsulation.
60- To hide any element (module, type, constructor, function) away
61- from * library consumers * prefix such an element with ` private ` keyword.
58+ As such Enso supports _ library private_ encapsulation. To hide any element
59+ (module, type, constructor, function) away from _ library consumers _ prefix such
60+ an element with ` private ` keyword.
0 commit comments