Skip to content

Commit

Permalink
Fix relative reference paths
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Mar 7, 2024
1 parent b861e15 commit e894a0a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ title: Introduction
Spice is a compiled language which sets a focus on performance and practicality. It is considered as a systems language,
which means that is rather not suitable for coding user interfaces, but for coding drivers and cli tools. Spice has
support for cross-compiling for multiple target platforms. In order to get started, visit the
[installation guide](../install/linux.md).
[installation guide](install/linux.md).
2 changes: 1 addition & 1 deletion docs/docs/language/for-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ for int i = 1; i <= 10; i++ {
!!! tip "Usage of loop alternatives"
For loops should only be used when it is foreseeable how often a block of code will run. If this is not the case, it
is recommended to use the [while loop](while-loops.md) or [do-while loop](do-while-loops.md) instead. If you want to
iterate over a container of items, consider using the [foreach loop](foreach-loop.md).
iterate over a container of items, consider using the [foreach loop](foreach-loops.md).
2 changes: 1 addition & 1 deletion docs/docs/language/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Hello World

In this example, we will code a simple "Hello World" program in Spice. What it does is to simply print "Hello World!" to the
console when it gets started. The guide assumes, that you already have Spice
[installed on your development system](install/linux.md) and are ready to go.
[installed on your development system](../install/linux.md) and are ready to go.

## Write your first program

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ Content: Hello World!
```

!!! tip
You can initialize or destroy structs by using [constructors](constructors.md) and [destructors](destructors.md).
You can initialize or destroy structs by using [constructors and destructors](constructors-destructors.md).
Read more about those in the respective documentation section.
11 changes: 8 additions & 3 deletions docs/docs/language/primitive-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
title: Primitive data types
---

Spice supports eight different primitive data types out of the box: `double`, `int`, `short`, `long`, `byte`, `char`, `string` and `bool`. In addition, there is a builtin type-inferred type, called `dyn`.
Spice supports eight different primitive data types out of the box: `double`, `int`, `short`, `long`, `byte`, `char`, `string` and
`bool`. In addition, there is a builtin type-inferred type, called `dyn`.
Let us take a look at each one individually!

## The `double` data type
Expand Down Expand Up @@ -108,7 +109,10 @@ variable2 = false;
You can find more information about that in the respective sections.

## The `dyn` data type
The `dyn` data type is a more unconventional data type. Dyn stands for dynamic and means that the `dyn` data type can hold any value of one of the eight types `double`, `int`, `short`, `long`, `byte`, `char`, `string` or `bool`. The concrete type of a `dyn` variable gets inferred at compile time so that the language stays type-safe. This also means, that as soon as you assign a value to a `dyn` variable, the type gets set fixed and is not mutable anymore.
The `dyn` data type is a more unconventional data type. Dyn stands for dynamic and means that the `dyn` data type can hold any
value of one of the eight types `double`, `int`, `short`, `long`, `byte`, `char`, `string` or `bool`. The concrete type of a `dyn`
variable gets inferred at compile time so that the language stays type-safe. This also means, that as soon as you assign a value
to a `dyn` variable, the type gets set fixed and is not mutable anymore.

Dyn variables can be defined like this:

Expand All @@ -122,4 +126,5 @@ variable3 = "demo string";
```

!!! note "Usage of the dyn data type"
The dyn data type can not be used everywhere. Function arguments can only be declared as `dyn`, when they have a default value attached to them. For more information about [functions](../functions), visit the respective documentation section.
The dyn data type can not be used everywhere. Function arguments can only be declared as `dyn`, when they have a default value
attached to them. For more information about [functions](functions.md), visit the respective documentation section.

0 comments on commit e894a0a

Please sign in to comment.