mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: add more links (#16303)
This commit is contained in:
parent
fa3019195c
commit
9de92eb391
19
doc/docs.md
19
doc/docs.md
@ -451,7 +451,7 @@ f32 f64
|
|||||||
|
|
||||||
isize, usize // platform-dependent, the size is how many bytes it takes to reference any location in memory
|
isize, usize // platform-dependent, the size is how many bytes it takes to reference any location in memory
|
||||||
|
|
||||||
voidptr // this one is mostly used for C interoperability
|
voidptr // this one is mostly used for [C interoperability](#v-and-c)
|
||||||
|
|
||||||
any // similar to C's void* and Go's interface{}
|
any // similar to C's void* and Go's interface{}
|
||||||
```
|
```
|
||||||
@ -685,8 +685,8 @@ See all methods of [string](https://modules.vlang.io/index.html#string)
|
|||||||
|
|
||||||
### Runes
|
### Runes
|
||||||
|
|
||||||
A `rune` represents a single Unicode character and is an alias for `u32`. To denote them, use `
|
A `rune` represents a single Unicode character and is an alias for `u32`.
|
||||||
(backticks) :
|
To denote them, use <code>`</code> (backticks) :
|
||||||
|
|
||||||
```v
|
```v
|
||||||
rocket := `🚀`
|
rocket := `🚀`
|
||||||
@ -1344,7 +1344,7 @@ print(m)
|
|||||||
Maps are ordered by insertion, like dictionaries in Python. The order is a
|
Maps are ordered by insertion, like dictionaries in Python. The order is a
|
||||||
guaranteed language feature. This may change in the future.
|
guaranteed language feature. This may change in the future.
|
||||||
|
|
||||||
See all methods of [map](https://modules.vlang.io/index.html#map)
|
See all methods of [map](https://modules.vlang.io/index.html#map) and [maps](https://modules.vlang.io/maps.html).
|
||||||
|
|
||||||
## Module imports
|
## Module imports
|
||||||
|
|
||||||
@ -2009,7 +2009,7 @@ assert p.x == 10
|
|||||||
### Heap structs
|
### Heap structs
|
||||||
|
|
||||||
Structs are allocated on the stack. To allocate a struct on the heap
|
Structs are allocated on the stack. To allocate a struct on the heap
|
||||||
and get a reference to it, use the `&` prefix:
|
and get a [reference](#references) to it, use the `&` prefix:
|
||||||
|
|
||||||
```v
|
```v
|
||||||
struct Point {
|
struct Point {
|
||||||
@ -2668,6 +2668,8 @@ struct Node<T> {
|
|||||||
|
|
||||||
To dereference a reference, use the `*` operator, just like in C.
|
To dereference a reference, use the `*` operator, just like in C.
|
||||||
|
|
||||||
|
see also [Stack and Heap](#stack-and-heap).
|
||||||
|
|
||||||
### Parameter evaluation order
|
### Parameter evaluation order
|
||||||
|
|
||||||
The evaluation order of the parameters of function calls is *NOT* guaranteed.
|
The evaluation order of the parameters of function calls is *NOT* guaranteed.
|
||||||
@ -5445,6 +5447,8 @@ conditional blocks inside it, i.e. `$if linux {}` etc.
|
|||||||
- `_notd_customflag.v` => similar to _d_customflag.v, but will be used
|
- `_notd_customflag.v` => similar to _d_customflag.v, but will be used
|
||||||
*only* if you do NOT pass `-d customflag` to V.
|
*only* if you do NOT pass `-d customflag` to V.
|
||||||
|
|
||||||
|
See also [Cross Compilation](#cross-compilation).
|
||||||
|
|
||||||
## Memory-unsafe code
|
## Memory-unsafe code
|
||||||
|
|
||||||
Sometimes for efficiency you may want to write low-level code that can potentially
|
Sometimes for efficiency you may want to write low-level code that can potentially
|
||||||
@ -5626,8 +5630,9 @@ the boolean expression is highly improbable. In the JS backend, that does nothin
|
|||||||
## Atomics
|
## Atomics
|
||||||
|
|
||||||
V has no special support for atomics, yet, nevertheless it's possible to treat variables as atomics
|
V has no special support for atomics, yet, nevertheless it's possible to treat variables as atomics
|
||||||
by calling C functions from V. The standard C11 atomic functions like `atomic_store()` are usually
|
by [calling C](#v-and-c) functions from V. The standard C11 atomic functions like `atomic_store()`
|
||||||
defined with the help of macros and C compiler magic to provide a kind of *overloaded C functions*.
|
are usually defined with the help of macros and C compiler magic to provide a kind of
|
||||||
|
*overloaded C functions*.
|
||||||
Since V does not support overloading functions by intention there are wrapper functions defined in
|
Since V does not support overloading functions by intention there are wrapper functions defined in
|
||||||
C headers named `atomic.h` that are part of the V compiler infrastructure.
|
C headers named `atomic.h` that are part of the V compiler infrastructure.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user