diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-06-03 10:50:20 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | 2a7d979226e98617623b550f207cec0e113ff04d (patch) | |
| tree | 0e9f2d2c36897af3a2569f287296928ba3bb9cf3 /docs/guide/syntax.md | |
| parent | add loop/recur (diff) | |
| download | alive-2a7d979226e98617623b550f207cec0e113ff04d.tar.gz alive-2a7d979226e98617623b550f207cec0e113ff04d.zip | |
split guide into guide and reference
Diffstat (limited to 'docs/guide/syntax.md')
| -rw-r--r-- | docs/guide/syntax.md | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/docs/guide/syntax.md b/docs/guide/syntax.md deleted file mode 100644 index 93f1c61..0000000 --- a/docs/guide/syntax.md +++ /dev/null @@ -1,43 +0,0 @@ -`alv`'s syntax is very similar to Lisp. Expressions take the form of -parenthesized lists like `(head a b c...)`, where the first element of the list -(`head`) is the name of an operator or function, which defines what the -expression as a whole will do, while the other elements are parameters whose -meaning depends on the `head`. Let's start with a simple operator, [print][]: -[print][] is used simply to print messages to the copilot console. - -## expressions -Elements of an expression have to be separated by whitespace, but any type of -and amount of whitespace is valid: feel free to use spaces, tabs, and newlines -to format code to your liking. The following are all equal and valid examples: - - (print "hello world") - - (+ 1 - 2 - 3) - - (print - "hello world") - - ( print "hello world" ) - -It is however recommended to follow the [clojure style guide][clojure-style] as -much as it does apply to alv. All further examples in this guide will respect -this guideline, so you might just pick it up simply by following this guide. - -## comments -To annotate your code, you can use comments. In `alv`, comments begin with -`#(` and end on a matching `)`. This way you can comment out a complete -expression simply by adding a `#` character in front. - - #(this is a comment) - - #(this is a long, - multi-line comment, - (and it also has nested parentheses). - It ends after this sentence.) - -You can put comments anywhere in your program where whitespace is allowed and -it will simply be ignored by `alv`. - -[clojure-style]: https://github.com/bbatsov/clojure-style-guide |
