Skip to content

Commit

Permalink
Use import statements in doc/perf.md (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Jan 23, 2023
1 parent e22dfbb commit 4212ad2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions doc/perf.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main()
```python
# fib40.jou (Jou program)
declare printf(format: byte*, ...) -> int
from "stdlib/io.jou" import printf
def fib(n: int) -> int:
if n <= 1:
Expand Down Expand Up @@ -199,8 +199,7 @@ TODO: write this section once a large Jou program exists and name it Example #1
Let's write a program that crashes if the user selects yes.

```python
declare printf(msg: byte*, ...) -> int
declare getchar() -> int
from "stdlib/io.jou" import printf, getchar

def main() -> int:
printf("Crash this program? (y/n) ")
Expand Down Expand Up @@ -242,9 +241,8 @@ Essentially it thinks that the `x = *foo` code will never run, because you aren'
Sidenote: if you want the program to crash with optimizations on, then you should do so using `abort()` function for example:

```python
declare printf(msg: byte*, ...) -> int
declare getchar() -> int
declare abort() -> void
from "stdlib/io.jou" import printf, getchar
from "stdlib/process.jou" import abort

def main() -> int:
printf("Crash this program? (y/n) ")
Expand Down

0 comments on commit 4212ad2

Please sign in to comment.