Tutorial
Display your first task
Run a Tea file and turn a binding into useful output.
Start in the tea-tasks directory you created in the overview. Create a file named tasks.tea and put these two lines in it:
tasks.tea
const title = "Learn Tea"
@println(`Task: ${title}`)Run the file:
tea tasks.teaTask: Learn TeaThat's the starting point for the task list. Tea runs statements at the top level of a file, so you don't need to declare an entrypoint function.
Read the two lines
const title = "Learn Tea" creates a binding named title. Tea infers that it holds a String from the value on the right. const prevents you from assigning a different value to that binding. We'll introduce var when we need a value that changes.
@println(...) writes a value followed by a newline. The @ identifies a built-in operation supplied by Tea; functions you write yourself don't use that prefix.
Double quotes make an ordinary string. Backticks make an interpolated string: the ${title} expression is evaluated and its value becomes part of the text. You can embed other expressions there too.
You don't need semicolons. A newline separates these statements.
Try it yourself
Change the task title and add a second line of output that says why you want to learn Tea. Run the file again.
One possible solution
const title = "Automate my daily notes"
@println(`Task: ${title}`)
@println("I want a small tool I can run from my terminal.")You now have a file you can edit and run. Next, you'll turn that single task into a list.
Read more: bindings and strings, built-in output functions.