runtime(doc): style fixes in vim9.txt (#13918)
Remove backticks and a few other style fixes Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@ -1265,7 +1265,7 @@ level. They cannot be created in a function, also not in a legacy function.
|
|||||||
yet. This will report any errors found during
|
yet. This will report any errors found during
|
||||||
compilation.
|
compilation.
|
||||||
|
|
||||||
:defc[ompile] MyClass Compile all methods in a class |class-compile|.
|
:defc[ompile] MyClass Compile all methods in a class. |class-compile|
|
||||||
|
|
||||||
:defc[ompile] {func}
|
:defc[ompile] {func}
|
||||||
:defc[ompile] debug {func}
|
:defc[ompile] debug {func}
|
||||||
@ -1720,8 +1720,8 @@ an example for each category: >
|
|||||||
Vim does not have a familiar null value; it has various null_<type> predefined
|
Vim does not have a familiar null value; it has various null_<type> predefined
|
||||||
values, for example |null_string|, |null_list|, |null_job|. Primitives do not
|
values, for example |null_string|, |null_list|, |null_job|. Primitives do not
|
||||||
have a null_<type>. The typical use cases for null_<type> are:
|
have a null_<type>. The typical use cases for null_<type> are:
|
||||||
- to `clear a variable` and release its resources;
|
- to clear a variable and release its resources;
|
||||||
- as a `default for a parameter` in a function definition, see |null-compare|.
|
- as a default for a parameter in a function definition, see |null-compare|.
|
||||||
|
|
||||||
For a specialized variable, like `job`, null_<type> is used to clear the
|
For a specialized variable, like `job`, null_<type> is used to clear the
|
||||||
resources. For a container variable, resources can also be cleared by
|
resources. 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: >
|
|||||||
F(null_list) # output: "null"
|
F(null_list) # output: "null"
|
||||||
F([]) # output: "not null, empty"
|
F([]) # output: "not null, empty"
|
||||||
F(['']) # output: "not null, not empty"
|
F(['']) # output: "not null, not empty"
|
||||||
The above function takes a `list of strings` and reports on it.
|
The above function takes a list of strings and reports on it.
|
||||||
Change the above function signature to accept different types of arguments: >
|
Change the above function signature to accept different types of arguments: >
|
||||||
def F(arg: list<any> = null_list) # any type of list
|
def F(arg: list<any> = null_list) # any type of list
|
||||||
def F(arg: any = null) # any type
|
def F(arg: any = null) # any type
|
||||||
@ -1791,8 +1791,8 @@ with vim9 null semantics, the programmer may chose to use null_<type> in
|
|||||||
comparisons and/or other situations.
|
comparisons and/or other situations.
|
||||||
|
|
||||||
Elsewhere in the documentation it says:
|
Elsewhere in the documentation it says:
|
||||||
Quite often a null value is handled the same as an
|
Quite often a null value is handled the same as an empty value, but
|
||||||
empty value, but not always
|
not always
|
||||||
Here's an example: >
|
Here's an example: >
|
||||||
vim9script
|
vim9script
|
||||||
var s1: list<string>
|
var s1: list<string>
|
||||||
|
|||||||
Reference in New Issue
Block a user