@@ -23,22 +23,22 @@ On the other hand, language *interoperability* is extremely useful: we want to e
23
23
### How does Julia define its public API?
24
24
25
25
Julia's public [ API] ( https://en.wikipedia.org/wiki/API ) is the behavior described in
26
- documentation of public symbols from ` Base ` and the standard libraries. Functions,
26
+ documentation of public bindings from ` Base ` and the standard libraries. Functions,
27
27
types, and constants are not part of the public API if they are not public, even if
28
28
they have docstrings or are described in the documentation. Further, only the documented
29
- behavior of public symbols is part of the public API. Undocumented behavior of public
30
- symbols is internal.
29
+ behavior of public bindings is part of the public API. Undocumented behavior of public
30
+ bindings is internal.
31
31
32
- Public symbols are those marked with either ` public foo ` or ` export foo ` .
32
+ Public bindings are those marked with either ` public foo ` or ` export foo ` .
33
33
34
34
In other words:
35
35
36
- - Documented behavior of public symbols is part of the public API.
37
- - Undocumented behavior of public symbols is not part of the public API.
38
- - Documented behavior of private symbols is not part of the public API.
39
- - Undocumented behavior of private symbols is not part of the public API.
36
+ - Documented behavior of public bindings is part of the public API.
37
+ - Undocumented behavior of public bindings is not part of the public API.
38
+ - Documented behavior of private bindings is not part of the public API.
39
+ - Undocumented behavior of private bindings is not part of the public API.
40
40
41
- You can get a complete list of the public symbols from a module with ` names(MyModule) ` .
41
+ You can get a complete list of the public bindings from a module with ` names(MyModule) ` .
42
42
43
43
Package authors are encouraged to define their public API similarly.
44
44
@@ -253,21 +253,21 @@ the variables `A` and `x` were distinct bindings referring to the same mutable `
253
253
### Can I use ` using ` or ` import ` inside a function?
254
254
255
255
No, you are not allowed to have a ` using ` or ` import ` statement inside a function. If you want
256
- to import a module but only use its symbols inside a specific function or set of functions, you
256
+ to import a module but only use its bindings inside a specific function or set of functions, you
257
257
have two options:
258
258
259
259
1 . Use ` import ` :
260
260
261
261
``` julia
262
262
import Foo
263
263
function bar (... )
264
- # ... refer to Foo symbols via Foo.baz ...
264
+ # ... refer to Foo bindings via Foo.baz ...
265
265
end
266
266
```
267
267
268
268
This loads the module ` Foo ` and defines a variable ` Foo ` that refers to the module, but does not
269
- import any of the other symbols from the module into the current namespace. You refer to the
270
- ` Foo ` symbols by their qualified names ` Foo.bar ` etc.
269
+ import any of the other bindings from the module into the current namespace. You refer to the
270
+ ` Foo ` bindings by their qualified names ` Foo.bar ` etc.
271
271
2 . Wrap your function in a module:
272
272
273
273
``` julia
@@ -281,7 +281,7 @@ have two options:
281
281
using Bar
282
282
```
283
283
284
- This imports all the symbols from ` Foo ` , but only inside the module ` Bar ` .
284
+ This imports all the bindings from ` Foo ` , but only inside the module ` Bar ` .
285
285
286
286
### What does the ` ... ` operator do?
287
287
0 commit comments