forked from Orchid/orchid
19 lines
422 B
Markdown
19 lines
422 B
Markdown
# Anatomy of a code file
|
|
|
|
```orchid
|
|
import std::io::(println, out) -- imports
|
|
|
|
-- single word substitution (alias)
|
|
greet == \name. printf out "Hello {}!\n" [name]
|
|
|
|
-- multi-word exported substitution with nonzero priority
|
|
export (...$pre ;) $a ...$post) =200=> (...$pre (greet $a) ...$post)
|
|
|
|
-- single-word exported substitution
|
|
export main == (
|
|
print "What is your name? >>
|
|
readln >>= \name.
|
|
greet name
|
|
)
|
|
```
|