diff --git a/README.md b/README.md index 7018116..0ff8512 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The Sabre compiler emits JavaScript, until the language has matured sufficiently fn main() { let num = 10 - return fib(num) + print(fib(num)) } fn fib(n) { diff --git a/docs/introduction/hello-world.md b/docs/introduction/hello-world.md index c974c07..4b0b118 100644 --- a/docs/introduction/hello-world.md +++ b/docs/introduction/hello-world.md @@ -2,8 +2,6 @@ Now that you have installed Sabre, it is time to write our first program. This is a program that will simply print a string to the screen. -> **Note:** Sabre is still at a very early state of development. Currently, the only way to print something to stdout is by returning a value from the `main` function. - # Creating a project directory Let's begin by setting up our development workspace. Sabre really doesn't care where you store the code, so feel free to choose a different directory, than the one in this example. @@ -23,7 +21,7 @@ Now open the main.sb file you just created and enter the following code: ``` fn main() { - return "Hello, world!" + print("Hello, world!") } ``` diff --git a/examples/fib.sb b/examples/fib.sb index e51fc19..557d65c 100644 --- a/examples/fib.sb +++ b/examples/fib.sb @@ -1,6 +1,6 @@ fn main() { let num = 10 - return fib(num) + print(fib(num)) } fn fib(n) { diff --git a/examples/greeter.sb b/examples/greeter.sb index e0f6708..1c8a654 100644 --- a/examples/greeter.sb +++ b/examples/greeter.sb @@ -1,5 +1,5 @@ fn main() { - return greet("World") + print(greet("World")) } fn greet(name) { diff --git a/examples/hello_world.sb b/examples/hello_world.sb index ddb9e95..061cd6f 100644 --- a/examples/hello_world.sb +++ b/examples/hello_world.sb @@ -1,3 +1,3 @@ fn main(n) { - return "Hello World" + print("Hello World") } diff --git a/examples/leapyear.sb b/examples/leapyear.sb index 4986ae5..483923b 100644 --- a/examples/leapyear.sb +++ b/examples/leapyear.sb @@ -10,8 +10,8 @@ fn main() { let ly = divisibleBy4 && divisibleBy100 if ly || divisibleBy400 { - return "Leap year" + print("Leap year") } else { - return "Not a leap year" + print("Not a leap year") } } \ No newline at end of file