@@ -1265,7 +1265,7 @@ level. They cannot be created in a function, also not in a legacy function.
12651265 yet. This will report any errors found during
12661266 compilation.
12671267
1268- :defc[ompile] MyClass Compile all methods in a class | class-compile | .
1268+ :defc[ompile] MyClass Compile all methods in a class. | class-compile |
12691269
12701270:defc[ompile] {func}
12711271:defc[ompile] debug {func}
@@ -1720,8 +1720,8 @@ an example for each category: >
17201720Vim does not have a familiar null value; it has various null_<type> predefined
17211721values, for example | null_string | , | null_list | , | null_job | . Primitives do not
17221722have a null_<type> . The typical use cases for null_<type> are:
1723- - to ` clear a variable` and release its resources;
1724- - as a ` default for a parameter` in a function definition, see | null-compare | .
1723+ - to clear a variable and release its resources;
1724+ - as a default for a parameter in a function definition, see | null-compare | .
17251725
17261726For a specialized variable, like `job` , null_<type> is used to clear the
17271727resources. For a container variable, resources can also be cleared by
@@ -1773,7 +1773,7 @@ an empty container, do not use null_<type> in a comparison: >
17731773 F(null_list) # output: "null"
17741774 F([]) # output: "not null, empty"
17751775 F(['']) # output: "not null, not empty"
1776- The above function takes a ` list of strings` and reports on it.
1776+ The above function takes a list of strings and reports on it.
17771777Change the above function signature to accept different types of arguments: >
17781778 def F(arg: list<any> = null_list) # any type of list
17791779 def F(arg: any = null) # any type
@@ -1791,18 +1791,18 @@ with vim9 null semantics, the programmer may chose to use null_<type> in
17911791comparisons and/or other situations.
17921792
17931793Elsewhere in the documentation it says:
1794- Quite often a null value is handled the same as an
1795- empty value, but not always
1794+ Quite often a null value is handled the same as an empty value, but
1795+ not always
17961796Here's an example: >
17971797 vim9script
17981798 var s1: list<string>
17991799 var s2: list<string> = null_list
18001800 echo s1 # output: "[]"
18011801 echo s2 # output: "[]"
1802-
1802+
18031803 echo s1 + ['a'] # output: "['a']"
18041804 echo s2 + ['a'] # output: "['a']"
1805-
1805+
18061806 echo s1->add('a') # output: "['a']"
18071807 echo s2->add('a') # E1130: Can not add to null list
18081808<
0 commit comments