From c25748cf8791bc010828310177bf75f942d36c2b Mon Sep 17 00:00:00 2001 From: Username404 Date: Wed, 22 Dec 2021 20:53:35 +0100 Subject: [PATCH] Rename the "println" function to "print_line" and fix HelloWorld.ybcon --- docs/gettingstarted.md | 8 ++++---- examples/HelloWorld.ybcon | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/gettingstarted.md b/docs/gettingstarted.md index 614d0cf..42fdc0e 100644 --- a/docs/gettingstarted.md +++ b/docs/gettingstarted.md @@ -34,14 +34,14 @@ as_main helloWorld >> {} Parameters can be added to an anonymous function by specifying the types as follows: ``` addIntToString (int, String) => { a, b; - println(b + a) + print_line(b + a) } ``` Named functions can have parameters **(with mandatory names)** like in this example: ``` addIntToString(a: Int, b: String) => { - println(b + a) + print_line(b + a) } ``` @@ -53,14 +53,14 @@ helloWorld() If a function does have parameters, you can call it with arguments in the right order; if the function is not anonymous, it's also possible to call it by using the names of the corresponding parameters: ``` addNumbers(int a, int b, int c, int d) >> { - println(a + b + c + d) + print_line(a + b + c + d) } addNumbers(1, 2, 3, 4) # Call without names addNumbers(a = 1, b = 2, c = 3, d = 4) # Call with names addNumbers(1, c = 3, b = 2, d = 4) ``` -Note that print and println are the functions that will get transpiled to their equivalents. +Note that print and print_line are the only functions that will get transpiled to their equivalents. ## 3 - Types Types are *inferred*, which means that specifying types of variables or returned values is optional. diff --git a/examples/HelloWorld.ybcon b/examples/HelloWorld.ybcon index e951080..17413c2 100644 --- a/examples/HelloWorld.ybcon +++ b/examples/HelloWorld.ybcon @@ -1,3 +1,3 @@ main #= [] -> { - println "Hello, World!" + print_line("Hello, World!") }