mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-09-19 15:48:27 +03:00
Improve entrypoint doc
This commit is contained in:
parent
78c1ee1c31
commit
de23e5c972
@ -236,22 +236,23 @@ main = (id foo)
|
||||
|
||||
If given the option, use another definition as entrypoint rather than `main` or `Main`.
|
||||
|
||||
> HVM-Lang finds by default for a `main` or `Main` as entrypoint to a program, but it is possible to use a different entrypoint with the `-e --entrypoint` option.
|
||||
> By default, HVM-Lang searches for a function named either `main` or `Main` to use as entrypoint to a program, but it is possible to use a different entrypoint with the `-e --entrypoint` option.
|
||||
|
||||
Example:
|
||||
```
|
||||
// program
|
||||
Main = (λx x λx x)
|
||||
|
||||
// compilation output, Main or main becomes a @main definition
|
||||
// compilation output, both `Main` and `main` compile to a `@main` definition
|
||||
@main = a
|
||||
& (b b) ~ ((c c) a)
|
||||
|
||||
// program
|
||||
// should fail as the program does not have a `main` definition.
|
||||
// Normally would fail as the program does not have a `main` definition.
|
||||
run = (λx x λx x)
|
||||
|
||||
// compilation output, --entrypoint run.
|
||||
// compilation output using `--entrypoint run`.
|
||||
// No `@main` definition is created.
|
||||
@run = a
|
||||
& (b b) ~ ((c c) a)
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user