Skip to content

Commit 0037f0c

Browse files
committed
doc: improve the logical order of the Compile time pseudo variables section
1 parent caf7d41 commit 0037f0c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

doc/docs.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6230,28 +6230,28 @@ Another example, is if you want to embed the version/name from v.mod *inside* yo
62306230
62316231
```v ignore
62326232
import v.vmod
6233-
vm := vmod.decode( @VMOD_FILE ) or { panic(err) }
6234-
eprintln('${vm.name} ${vm.version}\n ${vm.description}')
6233+
6234+
vm := vmod.decode( @VMOD_FILE )!
6235+
eprintln('${vm.name} ${vm.version}\n${vm.description}')
62356236
```
62366237
62376238
A program that prints its own source code (a quine):
62386239
```v
62396240
print($embed_file(@FILE).to_string())
62406241
```
62416242
6242-
A program that prints the time when it was built:
6243-
```v
6244-
import time
6245-
6246-
println('This program, was compiled at ${time.unix(@BUILD_TIMESTAMP.i64()).format_ss_milli()} .')
6247-
```
6248-
62496243
> [!NOTE]
62506244
> you can have arbitrary source code in the file, without problems, since the full file
62516245
> will be embedded into the executable, produced by compiling it. Also note that printing
62526246
> is done with `print` and not `println`, to not add another new line, missing in the
62536247
> source code.
62546248
6249+
A program that prints the time when it was built:
6250+
```v
6251+
import time
6252+
6253+
println('This program, was compiled at ${time.unix(@BUILD_TIMESTAMP.i64()).format_ss_milli()} .')
6254+
```
62556255
62566256
### Compile time reflection
62576257

0 commit comments

Comments
 (0)