From 6b12b8e5f5fba659640236859a07c1919572e133 Mon Sep 17 00:00:00 2001 From: Nichlas Severinsen Date: Wed, 15 Jan 2020 09:10:42 +0100 Subject: [PATCH] tvpl: Update chapter 2 example to work with latest version of voltlang, arch specifics --- doc/tvpl/c2-setup.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/tvpl/c2-setup.md b/doc/tvpl/c2-setup.md index 1e8b63b..d63fb1f 100644 --- a/doc/tvpl/c2-setup.md +++ b/doc/tvpl/c2-setup.md @@ -30,7 +30,7 @@ If you are on Ubuntu or a derivative, will install what you need. If you're on *Arch Linux*, - sudo pacman -S dmd llvm nasm git + sudo pacman -S dmd llvm nasm git clang gdc will do it. Otherwise consult your OS documentation on how to install these packages. @@ -67,6 +67,8 @@ Finally, [download and install git.](https://git-scm.com/download/win) Make sure Download [Battery](https://github.com/VoltLang/Battery/releases), Volt's build tool. Make sure it's on your `PATH`. +If you're on *Arch Linux* you can install [battery from the AUR](https://aur.archlinux.org/packages/battery/) with an [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers). + ### Getting The code Now that the dependencies have been installed, let's set up a place to build *Volta* and the tools it needs. For simplicity, this tutorial will assume this location is directly in your `$HOME` directory/User folder, but you can place it where you want. @@ -116,7 +118,7 @@ Then, so long as the `LLVM-C.DLL` that you built is in your `PATH` somewhere, yo Create a new folder, `hello`. In this folder would go all the code and tests that make up the project. All we want to do is print a message to the screen. -Save this code into a file called `main.volt`, and put that in a `src` folder inside the `hello` folder. +Inside of `hello`, create a new `src` folder, this is where your code will go. Save the code under into a file called `main.volt` inside the `src` folder. import watt.io; @@ -126,10 +128,17 @@ Save this code into a file called `main.volt`, and put that in a `src` folder in return 0; } -Then save the following in the root of the folder in a file called `battery.txt`. +Then save the following in the root of the folder in a file called `battery.toml`. + + name = "hello" + dependencies = ["watt"] + +Your folder structure should now look like this: - --dep - watt + hello/ + ├── src/ + │ └── main.volt + └── battery.toml For more information on Battery, check out [its documentation](https://github.com/VoltLang/Battery/blob/master/doc/index.md).