@@ -1599,11 +1599,11 @@ println('Your OS is ${current_os}.')
1599
1599
> This section is valid when .v files are not in the project's root directory.
1600
1600
1601
1601
Modules names in .v files, must match the name of their directory.
1602
-
1603
- A .v file ` ./abc/source.v ` must start with ` module abc ` . All .v files in this directory
1602
+
1603
+ A .v file ` ./abc/source.v ` must start with ` module abc ` . All .v files in this directory
1604
1604
belong to the same module ` abc ` . They should also start with ` module abc ` .
1605
1605
1606
- If you have ` abc/def/ ` , and .v files in both folders, you can ` import abc ` , but you will have
1606
+ If you have ` abc/def/ ` , and .v files in both folders, you can ` import abc ` , but you will have
1607
1607
to ` import abc.def ` too, to get to the symbols in the subfolder. It is independent.
1608
1608
1609
1609
In ` module name ` statement, name never repeats directory's hierarchy, but only its directory.
@@ -1637,7 +1637,7 @@ fn main() {
1637
1637
1638
1638
A function, located in ` abc/def/source.v ` , is called with ` def.func() ` , not ` abc.def.func() `
1639
1639
1640
- This always implies a * single prefix* , whatever sub-module depth. This behavior flattens
1640
+ This always implies a * single prefix* , whatever sub-module depth. This behavior flattens
1641
1641
modules/sub-modules hierarchy. Should you have two modules with the same name in different
1642
1642
directories, then you should use Module import aliasing (see below).
1643
1643
@@ -1963,7 +1963,7 @@ println(typ)
1963
1963
```
1964
1964
1965
1965
A match statement also can match the variant types of a ` sumtype ` . Note that
1966
- in that case, the match is exhaustive, since all variant types are mentioned
1966
+ in that case, the match is exhaustive, since all variant types are mentioned
1967
1967
explicitly, so there is no need for an ` else{} ` branch.
1968
1968
1969
1969
``` v nofmt
@@ -4730,12 +4730,12 @@ fn main() {
4730
4730
4731
4731
### Difference Between Channels and Shared Objects
4732
4732
4733
- ** Purpose** :
4733
+ ** Purpose** :
4734
4734
- Channels: Used for message passing between threads, ensuring safe communication.
4735
4735
- Shared objects: Used for direct data sharing and modification between threads.
4736
4736
4737
- ** Synchronization** :
4738
- - Channels: Implicit (via channel operations)
4737
+ ** Synchronization** :
4738
+ - Channels: Implicit (via channel operations)
4739
4739
- Shared objects: Explicit (via ` rlock ` /` lock ` blocks)
4740
4740
4741
4741
## JSON
@@ -5836,20 +5836,20 @@ pub mut:
5836
5836
5837
5837
Function/method deprecations:
5838
5838
5839
- Functions are deprecated before they are finally removed to give users time to migrate their code.
5840
- Adding a date is preferable in most cases. An immediate change, without a deprecation date, may be
5841
- used for functions that are found to be conceptually broken and obsoleted by much better
5842
- functionality. Other than that setting a date is advisable to grant users a grace period.
5839
+ Functions are deprecated before they are finally removed to give users time to migrate their code.
5840
+ Adding a date is preferable in most cases. An immediate change, without a deprecation date, may be
5841
+ used for functions that are found to be conceptually broken and obsoleted by much better
5842
+ functionality. Other than that setting a date is advisable to grant users a grace period.
5843
5843
5844
- Deprecated functions cause warnings, which cause errors if built with ` -prod` . To avoid immediate
5845
- CI breakage, it is advisable to set a future date, ahead of the date when the code is merged. This
5846
- gives people who actively developed V projects, the chance to see the deprecation notice at least
5847
- once and fix the uses. Setting a date in the next 30 days, assumes they would have compiled their
5844
+ Deprecated functions cause warnings, which cause errors if built with ` -prod` . To avoid immediate
5845
+ CI breakage, it is advisable to set a future date, ahead of the date when the code is merged. This
5846
+ gives people who actively developed V projects, the chance to see the deprecation notice at least
5847
+ once and fix the uses. Setting a date in the next 30 days, assumes they would have compiled their
5848
5848
projects manually at least once, within that time. For small changes, this should be plenty
5849
- of time. For complex changes, this time may need to be longer.
5849
+ of time. For complex changes, this time may need to be longer.
5850
5850
5851
- Different V projects and maintainers may reasonably choose different deprecation policies.
5852
- Depending on the type and impact of the change, you may want to consult with them first, before
5851
+ Different V projects and maintainers may reasonably choose different deprecation policies.
5852
+ Depending on the type and impact of the change, you may want to consult with them first, before
5853
5853
deprecating a function.
5854
5854
5855
5855
@@ -7710,7 +7710,7 @@ fn main() {
7710
7710
C.sqlite3_finalize(stmt)
7711
7711
println(' There are ${nr_users} users in the database.' )
7712
7712
7713
- error_msg := &char(0 )
7713
+ error_msg := &char(unsafe { nil } )
7714
7714
query_all_users := ' select * from users'
7715
7715
rc := C.sqlite3_exec(db, &char(query_all_users.str), my_callback, voidptr(7), &error_msg)
7716
7716
if rc != C.SQLITE_OK {
@@ -8193,7 +8193,7 @@ exists the file will be overridden. If you want to rebuild each time and not kee
8193
8193
instead use ` # !/usr/bin/env -S v -raw-vsh-tmp-prefix tmp run` .
8194
8194
8195
8195
Note: there is a small shell script ` cmd/tools/vrun` , that can be useful for systems, that have an
8196
- env program (` /usr/bin/env` ), that still does not support an ` -S` option (like BusyBox).
8196
+ env program (` /usr/bin/env` ), that still does not support an ` -S` option (like BusyBox).
8197
8197
See https://github.com/vlang/v/blob/master/cmd/tools/vrun for more details.
8198
8198
8199
8199
# Appendices
0 commit comments